diff options
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/diag_logs_settings.php | 10 | ||||
-rw-r--r-- | usr/local/www/firewall_nat_out_edit.php | 6 | ||||
-rw-r--r-- | usr/local/www/widgets/include/gmirror_status.inc | 13 |
3 files changed, 16 insertions, 13 deletions
diff --git a/usr/local/www/diag_logs_settings.php b/usr/local/www/diag_logs_settings.php index 5f40bd7..dc6d1c8 100644 --- a/usr/local/www/diag_logs_settings.php +++ b/usr/local/www/diag_logs_settings.php @@ -65,6 +65,7 @@ $pconfig['logall'] = isset($config['syslog']['logall']); $pconfig['system'] = isset($config['syslog']['system']); $pconfig['enable'] = isset($config['syslog']['enable']); $pconfig['logdefaultblock'] = !isset($config['syslog']['nologdefaultblock']); +$pconfig['logdefaultpass'] = isset($config['syslog']['nologdefaultpass']); $pconfig['logbogons'] = !isset($config['syslog']['nologbogons']); $pconfig['logprivatenets'] = !isset($config['syslog']['nologprivatenets']); $pconfig['loglighttpd'] = !isset($config['syslog']['nologlighttpd']); @@ -138,10 +139,12 @@ if ($_POST['resetlogs'] == gettext("Reset Log Files")) { $config['syslog']['disablelocallogging'] = $_POST['disablelocallogging'] ? true : false; $config['syslog']['enable'] = $_POST['enable'] ? true : false; $oldnologdefaultblock = isset($config['syslog']['nologdefaultblock']); + $oldnologdefaultpass = isset($config['syslog']['nologdefaultpass']); $oldnologbogons = isset($config['syslog']['nologbogons']); $oldnologprivatenets = isset($config['syslog']['nologprivatenets']); $oldnologlighttpd = isset($config['syslog']['nologlighttpd']); $config['syslog']['nologdefaultblock'] = $_POST['logdefaultblock'] ? false : true; + $config['syslog']['nologdefaultpass'] = $_POST['logdefaultpass'] ? true : false; $config['syslog']['nologbogons'] = $_POST['logbogons'] ? false : true; $config['syslog']['nologprivatenets'] = $_POST['logprivatenets'] ? false : true; $config['syslog']['nologlighttpd'] = $_POST['loglighttpd'] ? false : true; @@ -161,6 +164,7 @@ if ($_POST['resetlogs'] == gettext("Reset Log Files")) { $retval = 0; $retval = system_syslogd_start(); if (($oldnologdefaultblock !== isset($config['syslog']['nologdefaultblock'])) + || ($oldnologdefaultpass !== isset($config['syslog']['nologdefaultpass'])) || ($oldnologbogons !== isset($config['syslog']['nologbogons'])) || ($oldnologprivatenets !== isset($config['syslog']['nologprivatenets']))) $retval |= filter_configure(); @@ -307,9 +311,13 @@ function check_everything() { <td valign="top" class="vtable">Log Firewall Default Blocks</td> <td class="vtable"> <input name="logdefaultblock" type="checkbox" id="logdefaultblock" value="yes" <?php if ($pconfig['logdefaultblock']) echo "checked=\"checked\""; ?> /> - <strong><?=gettext("Log packets matched from the default rules put in the ruleset");?></strong><br /> + <strong><?=gettext("Log packets matched from the default block rules put in the ruleset");?></strong><br /> <?=gettext("Hint: packets that are blocked by the implicit default block rule will not be logged if you uncheck this option. Per-rule logging options are still respected.");?> <br /> + <input name="logdefaultpass" type="checkbox" id="logdefaultpass" value="yes" <?php if ($pconfig['logdefaultpass']) echo "checked=\"checked\""; ?> /> + <strong><?=gettext("Log packets matched from the default pass rules put in the ruleset");?></strong><br /> + <?=gettext("Hint: packets that are allowed by the implicit default pass rule will be logged if you check this option. Per-rule logging options are still respected.");?> + <br /> <input name="logbogons" type="checkbox" id="logbogons" value="yes" <?php if ($pconfig['logbogons']) echo "checked=\"checked\""; ?> /> <strong><?=gettext("Log packets blocked by 'Block Bogon Networks' rules");?></strong><br /> <br /> diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php index d22fc8e..7f7432d 100644 --- a/usr/local/www/firewall_nat_out_edit.php +++ b/usr/local/www/firewall_nat_out_edit.php @@ -413,13 +413,13 @@ function proto_change() { } } function poolopts_change() { - if (jQuery('#target option:selected').text().substring(0,4) == "Host") { + if (jQuery('#target option:selected').text().trim().substring(0,4) == "Host") { jQuery('#poolopts_tr').css('display',''); jQuery('#target_network').css('display','none'); - } else if (jQuery('#target option:selected').text().substring(0,6) == "Subnet") { + } else if (jQuery('#target option:selected').text().trim().substring(0,6) == "Subnet") { jQuery('#poolopts_tr').css('display',''); jQuery('#target_network').css('display','none'); - } else if (jQuery('#target option:selected').text().substring(0,5) == "Other") { + } else if (jQuery('#target option:selected').text().trim().substring(0,5) == "Other") { jQuery('#poolopts_tr').css('display',''); jQuery('#target_network').css('display',''); } else { diff --git a/usr/local/www/widgets/include/gmirror_status.inc b/usr/local/www/widgets/include/gmirror_status.inc index 414c394..8a04d4a 100644 --- a/usr/local/www/widgets/include/gmirror_status.inc +++ b/usr/local/www/widgets/include/gmirror_status.inc @@ -27,28 +27,23 @@ function gmirror_get_status() { $status = ""; - exec("/sbin/gmirror status", $status); + exec("/sbin/gmirror status -s", $status); $mirrors = array(); /* Empty output = no mirrors found */ if (count($status) > 0) { - /* We don't need the first row, it's just a header */ - $status = array_slice($status, 1); - /* Loop through gmirror status output. */ foreach ($status as $line) { /* Split the line by whitespace */ $all = preg_split("/[\s\t]+/", trim($line), 3); - if (count($all) == 3) { + if (count($all) == 3) { /* If there are three items on a line, it is mirror name, status, and component */ $currentmirror = $all[0]; $mirrors[$currentmirror]["name"] = $all[0]; $mirrors[$currentmirror]["status"] = $all[1]; - $mirrors[$currentmirror]["components"] = array(); + if (!is_array($mirrors[$currentmirror]["components"])) + $mirrors[$currentmirror]["components"] = array(); $mirrors[$currentmirror]["components"][] = $all[2]; - } elseif ((trim($line) != "") && (count($all) > 0)) { - /* If there is just one item on a line, it is a component name of the previous mirror */ - $mirrors[$currentmirror]["components"][] = trim($line); } } } |