diff options
Diffstat (limited to 'src/usr')
32 files changed, 483 insertions, 192 deletions
diff --git a/src/usr/local/www/diag_confbak.php b/src/usr/local/www/diag_confbak.php index 7e01c5c..cc8d137 100644 --- a/src/usr/local/www/diag_confbak.php +++ b/src/usr/local/www/diag_confbak.php @@ -208,7 +208,7 @@ print($form); if (is_array($confvers)) { ?> <div> - <div id="infoblock_open"> + <div class="infoblock_open"> <?=print_info_box( gettext( 'To view the differences between an older configuration and a newer configuration, ' . diff --git a/src/usr/local/www/diag_sockets.php b/src/usr/local/www/diag_sockets.php index 7727a65..5039d50 100644 --- a/src/usr/local/www/diag_sockets.php +++ b/src/usr/local/www/diag_sockets.php @@ -133,7 +133,7 @@ $showAllOption = $showAll ? "" : "?showAll"; ?> <div> -<div id="infoblock"> +<div class="infoblock"> <?php print_info_box(gettext('Socket information - explanation.') . '<br /><br />' . gettext('This page shows the output for the commands: "sockstat -4lL" and "sockstat -6lL".' . '<br />' . diff --git a/src/usr/local/www/diag_tables.php b/src/usr/local/www/diag_tables.php index 2c24d8c..4bd9319 100644 --- a/src/usr/local/www/diag_tables.php +++ b/src/usr/local/www/diag_tables.php @@ -90,6 +90,7 @@ if ($_POST['clearall']) { exec("/sbin/pfctl -t " . escapeshellarg($tablename) . " -T delete " . escapeshellarg($entry), $delete); } } + unset($entries); } if (($tablename == "bogons") || ($tablename == "bogonsv6")) { @@ -156,7 +157,20 @@ $form->add($section); print $form; if ($bogons || !empty($entries)) { - print_info_box(gettext("Table last updated on ") . exec('/usr/bin/grep -i -m 1 -E "^# last updated" /etc/' . escapeshellarg($tablename) . '|cut -d"(" -f2|tr -d ")" '), 'info'); +?> +<div> + <div class="infoblock_open"> +<?php + $last_updated = exec('/usr/bin/grep -i -m 1 -E "^# last updated" /etc/' . escapeshellarg($tablename) . '|cut -d"(" -f2|tr -d ")" '); + if ($last_updated != "") { + print_info_box(gettext("Table last updated on ") . $last_updated, 'info'); + } else { + print_info_box(gettext("Date of last update of table is unknown"), 'info'); + } +?> + </div> +</div> +<?php } ?> diff --git a/src/usr/local/www/firewall_aliases.php b/src/usr/local/www/firewall_aliases.php index f505d63..d0ff400 100644 --- a/src/usr/local/www/firewall_aliases.php +++ b/src/usr/local/www/firewall_aliases.php @@ -311,7 +311,7 @@ display_top_tabs($tab_array); <!-- Information section. Icon ID must be "showinfo" and the information <div> ID must be "infoblock". That way jQuery (in pfenseHelpers.js) will automatically take care of the display. --> <div> - <div id="infoblock"> + <div class="infoblock"> <?=print_info_box(gettext('Aliases act as placeholders for real hosts, networks or ports. They can be used to minimize the number ' . 'of changes that have to be made if a host, network or port changes. <br />' . 'You can enter the name of an alias instead of the host, network or port where indicated. The alias will be resolved according to the list above.' . '<br />' . diff --git a/src/usr/local/www/firewall_nat_1to1.php b/src/usr/local/www/firewall_nat_1to1.php index 016bf0b..320bad4 100644 --- a/src/usr/local/www/firewall_nat_1to1.php +++ b/src/usr/local/www/firewall_nat_1to1.php @@ -277,7 +277,7 @@ display_top_tabs($tab_array); </nav> </form> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box(gettext('Depending on the way your WAN connection is setup, you may also need a ') . '<a href="firewall_virtual_ip.php">' . gettext("Virtual IP.") . '</a>' . '<br />' . gettext('If you add a 1:1 NAT entry for any of the interface IPs on this system, ' . diff --git a/src/usr/local/www/firewall_nat_out.php b/src/usr/local/www/firewall_nat_out.php index 5b51d2d..cf61565 100644 --- a/src/usr/local/www/firewall_nat_out.php +++ b/src/usr/local/www/firewall_nat_out.php @@ -660,7 +660,7 @@ endif; </div> </form> -<div id="infoblock"> +<div class="infoblock"> <?php print_info_box(gettext('If automatic outbound NAT is selected, a mapping is automatically generated for each interface\'s subnet (except WAN-type connections) and the rules ' . 'on the "Mappings" section of this page are ignored.' . '<br />' . diff --git a/src/usr/local/www/firewall_rules.php b/src/usr/local/www/firewall_rules.php index 2a4c970..807d5a7 100644 --- a/src/usr/local/www/firewall_rules.php +++ b/src/usr/local/www/firewall_rules.php @@ -695,7 +695,7 @@ for ($i = 0; isset($a_filter[$i]); $i++): </nav> </form> -<div id="infoblock"> +<div class="infoblock"> <div class="alert alert-info clearfix" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><div class="pull-left"> <dl class="dl-horizontal responsive"> <!-- Legend --> diff --git a/src/usr/local/www/firewall_schedule.php b/src/usr/local/www/firewall_schedule.php index de4be3c..53ee0f4 100644 --- a/src/usr/local/www/firewall_schedule.php +++ b/src/usr/local/www/firewall_schedule.php @@ -279,7 +279,7 @@ endforeach; </a> </nav> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box(gettext('Schedules act as placeholders for time ranges to be used in Firewall Rules.'), 'info')?> </div> diff --git a/src/usr/local/www/firewall_shaper.php b/src/usr/local/www/firewall_shaper.php index a230003..f931b0f 100644 --- a/src/usr/local/www/firewall_shaper.php +++ b/src/usr/local/www/firewall_shaper.php @@ -506,7 +506,7 @@ if (!$dfltmsg && $sform) { if ($dfltmsg) { ?> <div> - <div id="infoblock"> + <div class="infoblock"> <?=print_info_box($default_shaper_msg, 'info')?> </div> </div> diff --git a/src/usr/local/www/firewall_virtual_ip.php b/src/usr/local/www/firewall_virtual_ip.php index cbe25c4..037d2d2 100644 --- a/src/usr/local/www/firewall_virtual_ip.php +++ b/src/usr/local/www/firewall_virtual_ip.php @@ -364,7 +364,7 @@ endforeach; </a> </nav> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box(gettext('The virtual IP addresses defined on this page may be used in ') . '<a href="firewall_nat.php">' . gettext('NAT') . '</a>' . gettext(' mappings.') . '<br />' . gettext('You can check the status of your CARP Virtual IPs and interfaces ') . '<a href="status_carp.php">' . gettext('here') . '</a>', 'info')?> </div> diff --git a/src/usr/local/www/firewall_virtual_ip_edit.php b/src/usr/local/www/firewall_virtual_ip_edit.php index 023efd6..f8b02d3 100644 --- a/src/usr/local/www/firewall_virtual_ip_edit.php +++ b/src/usr/local/www/firewall_virtual_ip_edit.php @@ -489,7 +489,7 @@ $form->add($section); print($form); ?> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box(gettext("Proxy ARP and Other type Virtual IPs cannot be bound to by anything running on the firewall, such as IPsec, OpenVPN, etc. Use a CARP or IP Alias type address for these types.") . '<br />' . sprintf(gettext("For more information on CARP and the above values, visit the OpenBSD %s"), '<a href="http://www.openbsd.org/faq/pf/carp.html">CARP FAQ</a>.'), 'info')?> </div> diff --git a/src/usr/local/www/interfaces_groups.php b/src/usr/local/www/interfaces_groups.php index 795bcc9..d832809 100644 --- a/src/usr/local/www/interfaces_groups.php +++ b/src/usr/local/www/interfaces_groups.php @@ -156,7 +156,7 @@ display_top_tabs($tab_array); </a> </nav> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box(gettext('Interface Groups allow you to setup rules for multiple interfaces without duplicating the rules.<br />' . 'If you remove members from an interface group, the group rules are no longer applicable to that interface.'), 'info')?> diff --git a/src/usr/local/www/interfaces_qinq.php b/src/usr/local/www/interfaces_qinq.php index 9e22c6e..de197ba 100644 --- a/src/usr/local/www/interfaces_qinq.php +++ b/src/usr/local/www/interfaces_qinq.php @@ -182,7 +182,7 @@ endforeach; </a> </nav> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box(sprintf(gettext('Not all drivers/NICs support 802.1Q QinQ tagging properly. <br />On cards that do not explicitly support it, ' . 'QinQ tagging will still work, but the reduced MTU may cause problems.<br />' . 'See the %s handbook for information on supported cards.'), $g['product_name']), 'info')?> diff --git a/src/usr/local/www/interfaces_vlan.php b/src/usr/local/www/interfaces_vlan.php index f9013cd..4742b09 100644 --- a/src/usr/local/www/interfaces_vlan.php +++ b/src/usr/local/www/interfaces_vlan.php @@ -170,7 +170,7 @@ display_top_tabs($tab_array); </div> </form> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box(sprintf(gettext('NOTE: Not all drivers/NICs support 802.1Q '. 'VLAN tagging properly. <br />On cards that do not explicitly support it, VLAN '. 'tagging will still work, but the reduced MTU may cause problems.<br />See the '. diff --git a/src/usr/local/www/jquery/pfSenseHelpers.js b/src/usr/local/www/jquery/pfSenseHelpers.js index 6d02d2d..61c6793 100644 --- a/src/usr/local/www/jquery/pfSenseHelpers.js +++ b/src/usr/local/www/jquery/pfSenseHelpers.js @@ -387,19 +387,19 @@ $('[id^=delete]').click(function(event) { // "More information" handlers // If there is an infoblock, automatically add an info icon that toggles its display -if($('#infoblock,#infoblock_open').length != 0) { - $('#infoblock,#infoblock_open').before('<i class="fa fa-info-circle icon-pointer" style="color: #337AB7;; font-size:20px; margin-left: 10px; margin-bottom: 10px;" id="showinfo" title="More information"></i>'); +if($('.infoblock,.infoblock_open,#infoblock').length != 0) { + $('.infoblock,.infoblock_open,#infoblock').before('<i class="fa fa-info-circle icon-pointer" style="color: #337AB7;; font-size:20px; margin-left: 10px; margin-bottom: 10px;" id="showinfo" title="More information"></i>'); // and remove the 'X' button from the last text box (Which we assume to be the infoblock) $('.close :last').remove(); } // Hide information on page load -$('#infoblock').hide(); +$('.infoblock,#infoblock').hide(); // Show the help on clicking the info icon $('#showinfo').click(function() { - $('#infoblock,#infoblock_open').toggle(); + $('.infoblock,.infoblock_open,#infoblock').toggle(); }); // Put a dummy row into any empty table to keep IE happy diff --git a/src/usr/local/www/services_captiveportal_filemanager.php b/src/usr/local/www/services_captiveportal_filemanager.php index 9ef63c8..56dbd73 100644 --- a/src/usr/local/www/services_captiveportal_filemanager.php +++ b/src/usr/local/www/services_captiveportal_filemanager.php @@ -271,7 +271,7 @@ endif; // The notes displayed on the page are large, the page content comparitively small. A "Note" button // is provided so that you only see the notes if you ask for them ?> -<div id="infoblock" class="panel panel-default"> +<div class="infoblock" class="panel panel-default"> <div class="panel-heading"><h2 class="panel-title">Notes</h2></div> <div class="panel-body"> <?=gettext("Any files that you upload here with the filename prefix of captiveportal- will " . diff --git a/src/usr/local/www/services_captiveportal_hostname.php b/src/usr/local/www/services_captiveportal_hostname.php index c40694a..5c7480f 100644 --- a/src/usr/local/www/services_captiveportal_hostname.php +++ b/src/usr/local/www/services_captiveportal_hostname.php @@ -196,7 +196,7 @@ endif; </a> </nav> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box($notestr)?> </div> diff --git a/src/usr/local/www/services_captiveportal_ip.php b/src/usr/local/www/services_captiveportal_ip.php index d321e75..ce3df1b 100644 --- a/src/usr/local/www/services_captiveportal_ip.php +++ b/src/usr/local/www/services_captiveportal_ip.php @@ -192,7 +192,7 @@ endif; </a> </nav> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box(gettext('Adding allowed IP addresses will allow IP access to/from these addresses through the captive portal without being taken to the portal page. ' . 'This can be used for a web server serving images for the portal page or a DNS server on another network, for example.'), 'info')?> </div> diff --git a/src/usr/local/www/services_captiveportal_mac.php b/src/usr/local/www/services_captiveportal_mac.php index 9a4cbb5..5ce5467 100644 --- a/src/usr/local/www/services_captiveportal_mac.php +++ b/src/usr/local/www/services_captiveportal_mac.php @@ -255,7 +255,7 @@ endif; </a> </nav> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box(gettext('Adding MAC addresses as "pass" MACs allows them access through the captive portal automatically without being taken to the portal page.'), 'info')?> </div> <?php diff --git a/src/usr/local/www/services_igmpproxy.php b/src/usr/local/www/services_igmpproxy.php index 7b9f88b..7790200 100644 --- a/src/usr/local/www/services_igmpproxy.php +++ b/src/usr/local/www/services_igmpproxy.php @@ -183,7 +183,7 @@ endforeach; </a> </nav> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box(gettext('Please add the interface for upstream, the allowed subnets, and the downstream interfaces you would like the proxy to allow. ' . 'Only one "upstream" interface can be configured.'), 'info')?> </div> diff --git a/src/usr/local/www/services_ntpd.php b/src/usr/local/www/services_ntpd.php index 0600045..adde884 100644 --- a/src/usr/local/www/services_ntpd.php +++ b/src/usr/local/www/services_ntpd.php @@ -300,7 +300,7 @@ $section->addInput(new Form_Select( $timeservers = explode(' ', $config['system']['timeservers']); $maxrows = max(count($timeservers), 1); for ($counter=0; $counter < $maxrows; $counter++) { - $group = new Form_Group($counter == 0 ? 'Time servers':''); + $group = new Form_Group($counter == 0 ? 'Time Servers':''); $group->addClass('repeatable'); $group->add(new Form_Input( @@ -347,7 +347,7 @@ $section->addInput(new Form_StaticText( $section->addInput(new Form_Input( 'ntporphan', - 'Orphan mode', + 'Orphan Mode', 'text', $pconfig['ntporphan'] ))->setHelp('Orphan mode allows the system clock to be used when no other clocks are available. ' . @@ -363,15 +363,15 @@ $section->addInput(new Form_Checkbox( $section->addInput(new Form_Checkbox( 'logpeer', - 'Syslog logging', - 'Enable logging of peer messages (default: disabled).', + 'Logging', + 'Log peer messages (default: disabled).', $pconfig['logpeer'] )); $section->addInput(new Form_Checkbox( 'logsys', null, - 'Enable logging of system messages (default: disabled).', + 'Log system messages (default: disabled).', $pconfig['logsys'] ))->setHelp('These options enable additional messages from NTP to be written to the System Log ' . '<a href="diag_logs_ntpd.php">' . 'Status > System Logs > NTP' . '</a>'); @@ -385,28 +385,28 @@ $btnadvstats = new Form_Button( $btnadvstats->removeClass('btn-primary')->addClass('btn-default btn-sm'); $section->addInput(new Form_StaticText( - 'Statistics logging', + 'Statistics Logging', $btnadvstats ))->setHelp('Warning: These options will create persistent daily log files in /var/log/ntp.'); $section->addInput(new Form_Checkbox( 'clockstats', null, - 'Enable logging of reference clock statistics (default: disabled).', + 'Log reference clock statistics (default: disabled).', $pconfig['clockstats'] )); $section->addInput(new Form_Checkbox( 'loopstats', null, - 'Enable logging of clock discipline statistics (default: disabled).', + 'Log clock discipline statistics (default: disabled).', $pconfig['loopstats'] )); $section->addInput(new Form_Checkbox( 'peerstats', null, - 'Enable logging of NTP peer statistics (default: disabled).', + 'Log NTP peer statistics (default: disabled).', $pconfig['peerstats'] )); @@ -426,43 +426,43 @@ $section->addInput(new Form_StaticText( $section->addInput(new Form_Checkbox( 'kod', null, - 'Enable Kiss-o\'-death packets (default: enabled).', - $pconfig['kod'] + 'Enable Kiss-o\'-death packets (default: checked).', + !$pconfig['kod'] )); $section->addInput(new Form_Checkbox( 'nomodify', null, - 'Deny state modifications (i.e. run time configuration) by ntpq and ntpdc (default: enabled).', - $pconfig['nomodify'] + 'Deny state modifications (i.e. run time configuration) by ntpq and ntpdc (default: checked).', + !$pconfig['nomodify'] )); $section->addInput(new Form_Checkbox( 'noquery', null, - 'Disable ntpq and ntpdc queries (default: disabled).', + 'Disable ntpq and ntpdc queries (default: unchecked).', $pconfig['noquery'] )); $section->addInput(new Form_Checkbox( 'noserve', null, - 'Disable all except ntpq and ntpdc queries (default: disabled).', + 'Disable all except ntpq and ntpdc queries (default: unchecked).', $pconfig['noserve'] )); $section->addInput(new Form_Checkbox( 'nopeer', null, - 'Deny packets that attempt a peer association (default: enabled).', - $pconfig['nopeer'] + 'Deny packets that attempt a peer association (default: checked).', + !$pconfig['nopeer'] )); $section->addInput(new Form_Checkbox( 'notrap', null, - 'Deny mode 6 control message trap service (default: enabled).', - $pconfig['notrap'] + 'Deny mode 6 control message trap service (default: checked).', + !$pconfig['notrap'] ))->addClass('advrestrictions'); // Leap seconds section @@ -522,6 +522,7 @@ events.push(function() { // On click, show the controls in the restrictions section $("#btnadvrestr").click(function() { + hideCheckbox('kod', false); hideCheckbox('nomodify', false); hideCheckbox('noquery', false); hideCheckbox('noserve', false); diff --git a/src/usr/local/www/services_ntpd_gps.php b/src/usr/local/www/services_ntpd_gps.php index fc60424..5b68470 100644 --- a/src/usr/local/www/services_ntpd_gps.php +++ b/src/usr/local/www/services_ntpd_gps.php @@ -249,7 +249,7 @@ $gpstypes = array('Custom', 'Default', 'Generic', 'Garmin', 'MediaTek', 'SiRF', $section->addInput(new Form_Select( 'gpstype', - 'GPS', + 'GPS Type', $pconfig['type'], array_combine($gpstypes, $gpstypes) ))->setHelp('This option allows you to select a predefined configuration. ' . @@ -268,7 +268,7 @@ if (!empty($serialports)) { $section->addInput(new Form_Select( 'gpsport', - 'Serial port', + 'Serial Port', $pconfig['port'], $splist ))->setHelp('All serial ports are listed, be sure to pick the port with the GPS attached. '); @@ -294,14 +294,14 @@ $section->addInput(new Form_Select( $section->addInput(new Form_Input( 'gpsfudge1', - 'Fudge time 1', + 'Fudge Time 1', 'text', $pconfig['fudge1'] ))->setHelp('Fudge time 1 is used to specify the GPS PPS signal offset (default: 0.0).'); $section->addInput(new Form_Input( 'gpsfudge2', - 'Fudge time 2', + 'Fudge Time 2', 'text', $pconfig['fudge2'] ))->setHelp('Fudge time 2 is used to specify the GPS time offset (default: 0.0).'); @@ -316,49 +316,49 @@ $section->addInput(new Form_Input( $section->addInput(new Form_Checkbox( 'gpsprefer', 'Flags', - 'NTP should prefer this clock (default: enabled).', + 'Prefer this clock (default: checked).', !$pconfig['prefer'] )); $section->addInput(new Form_Checkbox( 'gpsselect', null, - 'NTP should not use this clock, it will be displayed for reference only (default: disabled).', + 'Do not use this clock, display for reference only (default: unchecked).', $pconfig['noselect'] )); $section->addInput(new Form_Checkbox( 'gpsflag1', null, - 'Enable PPS signal processing (default: enabled).', + 'Enable PPS signal processing (default: checked).', $pconfig['flag1'] )); $section->addInput(new Form_Checkbox( 'gpsflag2', null, - 'Enable falling edge PPS signal processing (default: rising edge).', + 'Enable falling edge PPS signal processing (default: unchecked, rising edge).', $pconfig['flag2'] )); $section->addInput(new Form_Checkbox( 'gpsflag3', null, - 'Enable kernel PPS clock discipline (default: enabled).', + 'Enable kernel PPS clock discipline (default: checked).', $pconfig['flag3'] )); $section->addInput(new Form_Checkbox( 'gpsflag4', null, - 'Obscure location in timestamp (default: unobscured).', + 'Obscure location in timestamp (default: unchecked, unobscured).', $pconfig['flag4'] )); $section->addInput(new Form_Checkbox( 'gpssubsec', null, - 'Log the sub-second fraction of the received time stamp (default: Not logged).', + 'Log the sub-second fraction of the received time stamp (default: unchecked, not logged).', $pconfig['subsec'] ))->setHelp('Enabling this will rapidly fill the log, but is useful for tuning Fudge time 2.'); diff --git a/src/usr/local/www/services_ntpd_pps.php b/src/usr/local/www/services_ntpd_pps.php index 98c1b37..b050168 100644 --- a/src/usr/local/www/services_ntpd_pps.php +++ b/src/usr/local/www/services_ntpd_pps.php @@ -167,24 +167,24 @@ $section->addInput(new Form_StaticText( $serialports = glob("/dev/cua?[0-9]{,.[0-9]}", GLOB_BRACE); if (!empty($serialports)) { - $splist = array(); - - foreach ($serialports as $port) { - $shortport = substr($port, 5); - $splist[$shortport] = $shortport; - } - - $section->addInput(new Form_Select( - 'ppsport', - 'Serial port', - $pconfig['port'], - $splist - ))->setHelp('All serial ports are listed, be sure to pick the port with the PPS source attached. '); + $splist = array(); + + foreach ($serialports as $port) { + $shortport = substr($port, 5); + $splist[$shortport] = $shortport; + } + + $section->addInput(new Form_Select( + 'ppsport', + 'Serial Port', + $pconfig['port'], + $splist + ))->setHelp('All serial ports are listed, be sure to pick the port with the PPS source attached. '); } $section->addInput(new Form_Input( 'ppsfudge1', - 'Fudge time', + 'Fudge Time', 'text', $pconfig['fudge1'] ))->setHelp('Fudge time is used to specify the PPS signal offset from the actual second such as the transmission delay between the transmitter and the receiver. (default: 0.0).'); @@ -199,21 +199,21 @@ $section->addInput(new Form_Input( $section->addInput(new Form_Checkbox( 'ppsflag2', 'Flags', - 'Enable falling edge PPS signal processing (default: rising edge).', + 'Enable falling edge PPS signal processing (default: unchecked, rising edge).', $pconfig['flag2'] )); $section->addInput(new Form_Checkbox( 'ppsflag3', null, - 'Enable kernel PPS clock discipline (default: disabled).', + 'Enable kernel PPS clock discipline (default: unchecked).', $pconfig['flag3'] )); $section->addInput(new Form_Checkbox( 'ppsflag4', null, - 'Record a timestamp once for each second, useful for constructing Allan deviation plots (default: disabled).', + 'Record a timestamp once for each second, useful for constructing Allan deviation plots (default: unchecked).', $pconfig['flag4'] )); diff --git a/src/usr/local/www/services_unbound.php b/src/usr/local/www/services_unbound.php index 1964247..ed445a0 100644 --- a/src/usr/local/www/services_unbound.php +++ b/src/usr/local/www/services_unbound.php @@ -542,7 +542,7 @@ endforeach; </a> </nav> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box(sprintf(gettext("If the DNS Resolver is enabled, the DHCP". " service (if enabled) will automatically serve the LAN IP". " address as a DNS server to DHCP clients so they will use". diff --git a/src/usr/local/www/status_logs_common.inc b/src/usr/local/www/status_logs_common.inc index 51c0646..35098ee 100644 --- a/src/usr/local/www/status_logs_common.inc +++ b/src/usr/local/www/status_logs_common.inc @@ -119,17 +119,17 @@ function tab_array_logs_common() { $tab_array[] = array(gettext("Dynamic View"), ($view == 'dynamic'), "/status_logs_filter_dynamic.php?logfile=filter&view=dynamic"); $tab_array[] = array(gettext("Summary View"), ($view == 'summary'), "/status_logs_filter_summary.php?logfile=filter&view=summary"); } - else if (in_array($logfile, array('poes', 'l2tp', 'vpn'))) { + else if (in_array($logfile, array('poes', 'l2tps', 'vpn'))) { $tab_array[] = array(gettext("PPPoE Logins"), (($logfile == 'vpn') && ($vpntype == "poes")), "/status_logs_vpn.php?logfile=vpn&vpntype=poes"); - $tab_array[] = array(gettext("PPPoE Raw"), + $tab_array[] = array(gettext("PPPoE Service"), (($logfile == 'poes') && ($vpntype == "poes")), "/status_logs_vpn.php?logfile=poes&vpntype=poes"); $tab_array[] = array(gettext("L2TP Logins"), (($logfile == 'vpn') && ($vpntype == "l2tp")), "/status_logs_vpn.php?logfile=vpn&vpntype=l2tp"); - $tab_array[] = array(gettext("L2TP Raw"), + $tab_array[] = array(gettext("L2TP Service"), (($logfile == 'l2tps') && ($vpntype == "l2tp")), "/status_logs_vpn.php?logfile=l2tps&vpntype=l2tp"); } diff --git a/src/usr/local/www/status_logs_filter.php b/src/usr/local/www/status_logs_filter.php index 2a28239..f28f048 100644 --- a/src/usr/local/www/status_logs_filter.php +++ b/src/usr/local/www/status_logs_filter.php @@ -349,14 +349,11 @@ if (!$rawfilter) { } ?> -<div id="infoblock"> - +<div class="infoblock"> <?php - print_info_box('<a href="https://doc.pfsense.org/index.php/What_are_TCP_Flags%3F">' . gettext("TCP Flags") . '</a>: F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, C - CWR' . '<br />' . '<i class="fa fa-minus-square-o icon-primary"></i> = Add to block list., <i class="fa fa-plus-square-o icon-primary"></i> = Pass traffic, <i class="fa fa-info icon-primary"></i> = Resolve'); - ?> </div> diff --git a/src/usr/local/www/status_logs_filter_dynamic.php b/src/usr/local/www/status_logs_filter_dynamic.php index 211b5c8..f8c7b49 100755 --- a/src/usr/local/www/status_logs_filter_dynamic.php +++ b/src/usr/local/www/status_logs_filter_dynamic.php @@ -477,7 +477,7 @@ function toggleListDescriptions() { <?php if ($tcpcnt > 0) { ?> -<div id="infoblock"> +<div class="infoblock"> <?php print_info_box('<a href="https://doc.pfsense.org/index.php/What_are_TCP_Flags%3F">' . gettext("TCP Flags") . '</a>: F - FIN, S - SYN, A or . - ACK, R - RST, P - PSH, U - URG, E - ECE, C - CWR'); diff --git a/src/usr/local/www/status_logs_filter_summary.php b/src/usr/local/www/status_logs_filter_summary.php index fff226d..b94f2e3 100644 --- a/src/usr/local/www/status_logs_filter_summary.php +++ b/src/usr/local/www/status_logs_filter_summary.php @@ -157,7 +157,7 @@ print("<br />"); $infomsg = sprintf(gettext('This is a summary of the last %1$s lines of the firewall log (Max %2$s).'), $gotlines, $lines); ?> <div> - <div id="infoblock_open"> + <div class="infoblock_open"> <?=print_info_box($infomsg, 'info');?> </div> </div> diff --git a/src/usr/local/www/status_logs_vpn.php b/src/usr/local/www/status_logs_vpn.php index a1335e7..ca4e887 100644 --- a/src/usr/local/www/status_logs_vpn.php +++ b/src/usr/local/www/status_logs_vpn.php @@ -1,4 +1,3 @@ -#!/usr/local/bin/php <?php /* status_logs_vpn.php @@ -65,52 +64,225 @@ ##|-PRIV -$vpns = array('poes' => 'PPPoE', 'l2tp' => 'L2TP'); - -$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("VPN")); -require("guiconfig.inc"); +require_once("status_logs_common.inc"); require_once("vpn.inc"); -$nentries = $config['syslog']['nentries']; -if (!$nentries) { - $nentries = 50; -} +/* +Build a list of allowed log files so we can reject others to prevent the page +from acting on unauthorized files. +*/ +$allowed_logs = array( + "vpn" => array("name" => "VPN Logins", + "shortcut" => "poes"), + "poes" => array("name" => "PPPoE Service", + "shortcut" => "poes"), + "l2tps" => array("name" => "L2TP Service", + "shortcut" => "l2tps"), +); -if (htmlspecialchars($_POST['vpntype'])) { - $vpntype = htmlspecialchars($_POST['vpntype']); -} elseif (htmlspecialchars($_GET['vpntype'])) { - $vpntype = htmlspecialchars($_GET['vpntype']); -} else { +// The logs to display are specified in a GET argument. Default to 'system' logs +if (!$_GET['logfile']) { + $logfile = 'vpn'; $vpntype = "poes"; -} -if (htmlspecialchars($_POST['mode'])) { - $mode = htmlspecialchars($_POST['mode']); -} elseif (htmlspecialchars($_GET['mode'])) { - $mode = htmlspecialchars($_GET['mode']); } else { - $mode = "login"; + $logfile = $_GET['logfile']; + $vpntype = $_GET['vpntype']; + if (!array_key_exists($logfile, $allowed_logs)) { + /* Do not let someone attempt to load an unauthorized log. */ + $logfile = 'vpn'; + $vpntype = "poes"; + } } -switch ($vpntype) { - case 'poes': - $logname = "poes"; - break; - case 'l2tp': - $logname = "l2tps"; - break; + +if ($vpntype == 'poes') { $allowed_logs['vpn']['name'] = "PPPoE Logins"; } +if ($vpntype == 'l2tp') { $allowed_logs['vpn']['name'] = "L2TP Logins"; } + + +// Log Filter Submit - VPN +log_filter_form_vpn_submit(); + + +// Manage Log Section - Code +manage_log_code(); + + +// Status Logs Common - Code +status_logs_common_code(); + + +if ($filtertext) { + $filtertextmeta="?filtertext=$filtertext"; } -if ($_POST['clear']) { - if ($mode != "raw") { - clear_log_file("/var/log/vpn.log"); +$pgtitle = array(gettext("Status"), gettext("System logs"), gettext($allowed_logs[$logfile]["name"])); +include("head.inc"); + +if (!$input_errors && $savemsg) { + print_info_box($savemsg); + $manage_log_active = false; +} + + +// Tab Array +tab_array_logs_common(); + + +// Filter Section/Form - VPN +filter_form_vpn(); + + +// Now the forms are complete we can draw the log table and its controls +if (!$rawfilter) { + if ($filterlogentries_submit) { + $filterlog = conv_log_filter($logfile_path, $nentries, $nentries + 100, $filterfieldsarray); } else { - clear_log_file("/var/log/{$logname}.log"); + $filterlog = conv_log_filter($logfile_path, $nentries, $nentries + 100, $filtertext); + } + + // Remove those not of the selected vpn type (poes / l2tp). + if ($logfile == "vpn") { + foreach ($filterlog as $key => $filterent) { + if (!preg_match('/' . $vpntype . '/', $filterent['type'])) { + unset($filterlog[$key]); + } + } + } +?> + +<div class="panel panel-default"> + <div class="panel-heading"> + <h2 class="panel-title"> +<?php + if ((!$filtertext) && (!$filterfieldsarray)) { + printf(gettext("Last %d %s log entries."), count($filterlog), gettext($allowed_logs[$logfile]["name"])); + } else { + printf(gettext("%d matched %s log entries."), count($filterlog), gettext($allowed_logs[$logfile]["name"])); + } + + printf(" (" . gettext("Maximum %d") . ")", $nentries); +?> + </h2> + </div> + <div class="panel-body"> + <div class="table-responsive"> + <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable> +<?php + if ($logfile == "vpn") { +?> + <thead> + <tr class="text-nowrap"> + <th><?=gettext("Time")?></th> + <th><?=gettext("Action")?></th> + <th><?=gettext("User")?></th> + <th><?=gettext("IP Address")?></th> + </tr> + </thead> + <tbody> +<?php + foreach ($filterlog as $filterent) { +?> + <tr class="text-nowrap"> + <td> + <?=htmlspecialchars($filterent['time'])?> + </td> + <td style="word-wrap:break-word; word-break:break-all; white-space:normal"> + <? if ($filterent['action'] == "login") { ?> + <i class="fa fa-arrow-left" title="in"></i> + <? } else if ($filterent['action'] == "logout") { ?> + <i class="fa fa-arrow-right" title="out"></i> + <? } else { ?> + <i><?=htmlspecialchars($filterent['action'])?></i> + <? } ?> + </td> + <td> + <?=htmlspecialchars($filterent['user'])?> + </td> + <td> + <?=htmlspecialchars($filterent['ip_address'])?> + </td> + </tr> +<?php + } // e-o-foreach +?> + </tbody> +<?php + } else { +?> + <thead> + <tr class="text-nowrap"> + <th><?=gettext("Time")?></th> + <th><?=gettext("Type")?></th> + <th><?=gettext("PID")?></th> + <th style="width:100%"><?=gettext("Log Message")?></th> + </tr> + </thead> + <tbody> +<?php + foreach ($filterlog as $filterent) { +?> + <tr class="text-nowrap"> + <td> + <?=htmlspecialchars($filterent['time'])?> + </td> + <td> + <?=htmlspecialchars($filterent['type'])?> + </td> + <td> + <?=htmlspecialchars($filterent['pid'])?> + </td> + <td style="word-wrap:break-word; word-break:break-all; white-space:normal"> + <?=htmlspecialchars($filterent['message'])?> + </td> + </tr> +<?php + } // e-o-foreach +?> + </tbody> +<?php + } +?> + </table> +<?php + if (count($filterlog) == 0) { + print_info_box(gettext('No logs to display')); + } +?> + </div> + </div> +</div> +<?php +} else { +?> +<div class="panel panel-default"> + <div class="panel-heading"><h2 class="panel-title"><?=gettext("Last ")?><?=$nentries?> <?=gettext($allowed_logs[$logfile]["name"])?><?=gettext(" log entries")?></h2></div> + <div class="panel-body"> + <pre><?php + $rows = dump_clog_no_table($logfile_path, $nentries, true, array($filtertext)); + ?></pre> +<?php + if ($rows == 0) { + print_info_box(gettext('No logs to display')); } +?> + </div> +</div> +<?php } +?> + +<?php +# Manage Log - Section/Form +manage_log_section(); +?> +<?php function dump_clog_vpn($logfile, $tail) { global $g, $config, $vpntype; $sor = isset($config['syslog']['reverse']) ? "-r" : ""; + $specific_log = basename($logfile, '.log') . '_settings'; + if ($config['syslog'][$specific_log]['cronorder'] == 'forward') $sor = ""; + if ($config['syslog'][$specific_log]['cronorder'] == 'reverse') $sor = "-r"; $logarr = ""; @@ -118,6 +290,7 @@ function dump_clog_vpn($logfile, $tail) { $rows = 0; foreach ($logarr as $logent) { + $rows++; $logent = preg_split("/\s+/", $logent, 6); $llent = explode(",", $logent[5]); $iftype = substr($llent[1], 0, 4); @@ -139,88 +312,194 @@ function dump_clog_vpn($logfile, $tail) { } return($rows); } - -include("head.inc"); - -$tab_array = array(); -$tab_array[] = array(gettext("System"), false, "status_logs.php"); -$tab_array[] = array(gettext("Firewall"), false, "status_logs_filter.php"); -$tab_array[] = array(gettext("DHCP"), false, "status_logs.php?logfile=dhcpd"); -$tab_array[] = array(gettext("Portal Auth"), false, "status_logs.php?logfile=portalauth"); -$tab_array[] = array(gettext("IPsec"), false, "status_logs.php?logfile=ipsec"); -$tab_array[] = array(gettext("PPP"), false, "status_logs.php?logfile=ppp"); -$tab_array[] = array(gettext("VPN"), true, "status_logs_vpn.php"); -$tab_array[] = array(gettext("Load Balancer"), false, "status_logs.php?logfile=relayd"); -$tab_array[] = array(gettext("OpenVPN"), false, "status_logs.php?logfile=openvpn"); -$tab_array[] = array(gettext("NTP"), false, "status_logs.php?logfile=ntpd"); -$tab_array[] = array(gettext("Settings"), false, "status_logs_settings.php"); -display_top_tabs($tab_array); - -$tab_array = array(); -$tab_array[] = array(gettext("PPPoE Logins"), - (($vpntype == "poes") && ($mode != "raw")), - "/status_logs_vpn.php?vpntype=poes"); -$tab_array[] = array(gettext("PPPoE Raw"), - (($vpntype == "poes") && ($mode == "raw")), - "/status_logs_vpn.php?vpntype=poes&mode=raw"); -$tab_array[] = array(gettext("L2TP Logins"), - (($vpntype == "l2tp") && ($mode != "raw")), - "/status_logs_vpn.php?vpntype=l2tp"); -$tab_array[] = array(gettext("L2TP Raw"), - (($vpntype == "l2tp") && ($mode == "raw")), - "/status_logs_vpn.php?vpntype=l2tp&mode=raw"); -display_top_tabs($tab_array, false, 'nav nav-tabs'); -?> - -<!-- Raw logs are displayed as preformatted text. vpn logs are displayed as a table--> -<div class="panel panel-default"> - <div class="panel-heading"><h2 class="panel-title"><?=gettext("Last ")?><?=$nentries?> <?=$vpns[$vpntype]?><?=gettext(" log entries")?></h2></div> - <div class="panel-body"> -<?php - if ($mode != "raw") { -?> - <div class="table-responsive"> - <table class="table table-striped table-hover table-condensed"> - <thead> - <tr> - <th><?=gettext("Time")?></th> - <th><?=gettext("Action")?></th> - <th><?=gettext("User")?></th> - <th><?=gettext("IP address")?></th> - </tr> - </thead> - <tbody> -<?php - $rows = dump_clog_vpn("/var/log/vpn.log", $nentries); // dump_clog_vpn provides all the need <td></td>/<tr></tr> tags ?> - </tbody> - </table> + <?php - if ($rows == 0) { - print_info_box('No logs to display'); - } +// Log Filter Submit - VPN +function log_filter_form_vpn_submit() { + + global $filtersubmit, $interfacefilter, $filtertext; + global $filterlogentries_submit, $filterfieldsarray, $actpass, $actblock; + global $filter_active, $filterlogentries_qty; + + $filtersubmit = getGETPOSTsettingvalue('filtersubmit', null); + + if ($filtersubmit) { + $filter_active = true; + $filtertext = getGETPOSTsettingvalue('filtertext', ""); + $filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null); + } + + $filterlogentries_submit = getGETPOSTsettingvalue('filterlogentries_submit', null); + + if ($filterlogentries_submit) { + $filter_active = true; + $filterfieldsarray = array(); + + $filterfieldsarray['time'] = getGETPOSTsettingvalue('filterlogentries_time', null); + $filterfieldsarray['type'] = getGETPOSTsettingvalue('filterlogentries_type', null); + $filterfieldsarray['pid'] = getGETPOSTsettingvalue('filterlogentries_pid', null); + $filterfieldsarray['message'] = getGETPOSTsettingvalue('filterlogentries_message', null); + $filterfieldsarray['action'] = getGETPOSTsettingvalue('filterlogentries_action', null); + $filterfieldsarray['user'] = getGETPOSTsettingvalue('filterlogentries_user', null); + $filterfieldsarray['ip_address'] = getGETPOSTsettingvalue('filterlogentries_ip_address', null); + $filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null); + } +} ?> - </div> + <?php +// Filter Section/Form - VPN +function filter_form_vpn() { + + global $filter_active, $rawfilter, $filterfieldsarray, $filtertext, $filterlogentries_qty, $nentries, $Include_Act, $interfacefilter; + global $logfile; + + if ($filter_active) { + $filter_state = SEC_OPEN; + } else { + $filter_state = SEC_CLOSED; + } + + if (!$rawfilter) { // Advanced log filter form + $form = new Form(false); + + $section = new Form_Section('Advanced Log Filter', 'adv-filter-panel', COLLAPSIBLE|$filter_state); + + if ($logfile == "vpn") { + $group = new Form_Group(''); + + $group->add(new Form_Input( + 'filterlogentries_time', + null, + 'text', + $filterfieldsarray['time'] + ))->setWidth(3)->setHelp('Time'); + + $group->add(new Form_Input( + 'filterlogentries_action', + null, + 'text', + $filterfieldsarray['action'] + ))->setWidth(3)->setHelp('Action'); + + $group->add(new Form_Input( + 'filterlogentries_qty', + null, + 'number', + $filterlogentries_qty, + ['placeholder' => $nentries] + ))->setWidth(2)->setHelp('Quantity'); + + $section->add($group); + + $group = new Form_Group(''); + + $group->add(new Form_Input( + 'filterlogentries_user', + null, + 'text', + $filterfieldsarray['user'] + ))->setWidth(3)->setHelp('User'); + + $group->add(new Form_Input( + 'filterlogentries_ip_address', + null, + 'text', + $filterfieldsarray['ip_address'] + ))->setWidth(4)->setHelp('IP Address'); } else { -?> - <pre> -<?php - if (dump_clog_no_table("/var/log/{$logname}.log", $nentries) == 0) { - print('No logs to display'); - } -?> - </pre> -<?php + $group = new Form_Group(''); + + $group->add(new Form_Input( + 'filterlogentries_time', + null, + 'text', + $filterfieldsarray['time'] + ))->setWidth(3)->setHelp('Time'); + + $group->add(new Form_Input( + 'filterlogentries_type', + null, + 'text', + $filterfieldsarray['type'] + ))->setWidth(2)->setHelp('Type'); + + $group->add(new Form_Input( + 'filterlogentries_pid', + null, + 'text', + $filterfieldsarray['pid'] + ))->setWidth(2)->setHelp('PID'); + + $group->add(new Form_Input( + 'filterlogentries_qty', + null, + 'number', + $filterlogentries_qty, + ['placeholder' => $nentries] + ))->setWidth(2)->setHelp('Quantity'); + + $section->add($group); + + $group = new Form_Group(''); + + $group->add(new Form_Input( + 'filterlogentries_message', + null, + 'text', + $filterfieldsarray['message'] + ))->setWidth(7)->setHelp('Log Message'); + } + $btnsubmit = new Form_Button( + 'filterlogentries_submit', + ' ' . gettext('Apply Filter'), + null, + 'fa-filter' + ); + } else { // Simple log filter form + $form = new Form(false); + + $section = new Form_Section('Log Filter', 'basic-filter-panel', COLLAPSIBLE|$filter_state); + + $group = new Form_Group(''); + + $group->add(new Form_Input( + 'filtertext', + null, + 'text', + $filtertext + ))->setWidth(6)->setHelp('Filter Expression'); + + $group->add(new Form_Input( + 'filterlogentries_qty', + null, + 'number', + $filterlogentries_qty, + ['placeholder' => $nentries] + ))->setWidth(2)->setHelp('Quantity'); + + $btnsubmit = new Form_Button( + 'filtersubmit', + ' ' . gettext('Apply Filter'), + null, + 'fa-filter' + ); + } + + $btnsubmit->removeClass('btn-primary')->addClass('btn-success')->addClass('btn-sm'); + + $group->add(new Form_StaticText( + '', + $btnsubmit + )); + + $group->setHelp('<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">' . gettext('Regular expression reference') . '</a> ' . gettext('Precede with exclamation (!) to exclude match.')); + $section->add($group); + $form->add($section); + print $form; +} ?> - <form action="status_logs_vpn.php" method="post"> - <input type="hidden" name="vpntype" id="vpntype" value="<?=$vpntype?>" /> - <input type="hidden" name="mode" id="mode" value="<?=$mode?>" /> - <input name="clear" type="submit" class="btn btn-danger" value="<?=gettext("Clear log")?>" /> - </form> - <p> - </p> - </div> -</div> -<?php include("foot.inc"); + +<?php include("foot.inc"); ?> diff --git a/src/usr/local/www/system_gateway_groups.php b/src/usr/local/www/system_gateway_groups.php index 4185e9c..c4c98b0 100644 --- a/src/usr/local/www/system_gateway_groups.php +++ b/src/usr/local/www/system_gateway_groups.php @@ -201,7 +201,7 @@ endforeach; </a> </nav> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box(gettext('Remember to use these Gateway Groups in firewall rules in order to enable load balancing, failover, ' . 'or policy-based routing.' . '<br />' . 'Without rules directing traffic into the Gateway Groups, they will not be used.'), 'info')?> diff --git a/src/usr/local/www/system_usermanager.php b/src/usr/local/www/system_usermanager.php index c42d1e7..825c47f 100644 --- a/src/usr/local/www/system_usermanager.php +++ b/src/usr/local/www/system_usermanager.php @@ -542,7 +542,7 @@ foreach ($a_user as $i => $userent): </nav> </form> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box(gettext("Additional users can be added here. User permissions for accessing " . "the webConfigurator can be assigned directly or inherited from group memberships. " . "An icon that appears grey indicates that it is a system defined object. " . diff --git a/src/usr/local/www/vpn_ipsec.php b/src/usr/local/www/vpn_ipsec.php index 54bf3b8..41cdd0c 100644 --- a/src/usr/local/www/vpn_ipsec.php +++ b/src/usr/local/www/vpn_ipsec.php @@ -561,7 +561,7 @@ display_top_tabs($tab_array); </nav> </form> -<div id="infoblock"> +<div class="infoblock"> <?=print_info_box('<strong>' . gettext("Note:") . '</strong><br />' . gettext("You can check your IPsec status at ") . '<a href="status_ipsec.php">' . gettext("Status:IPsec") . '</a>.<br />' . gettext("IPsec Debug Mode can be enabled at ") . '<a href="vpn_ipsec_settings.php">' .gettext("VPN:IPsec:Advanced Settings") . '</a>.<br />' . |