diff options
author | derelict-pf <cjl@netgate.com> | 2017-01-08 18:03:04 -0800 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-01-11 09:35:49 -0200 |
commit | 05a13eba96b5d9bcb75750a37f174e8834e2b879 (patch) | |
tree | f01f81ae8707f1c63132974dec0e7dacb1503d6a /src/usr | |
parent | 4c4cd8a766449a68d71e3080eb9fe159ea37ac38 (diff) | |
download | pfsense-05a13eba96b5d9bcb75750a37f174e8834e2b879.zip pfsense-05a13eba96b5d9bcb75750a37f174e8834e2b879.tar.gz |
Add requirestatefilter. Implements #7069.
(cherry picked from commit 0a3150896bc412868cfb79473293ed81c87a50a7)
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/local/www/diag_dump_states.php | 13 | ||||
-rw-r--r-- | src/usr/local/www/system.php | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/usr/local/www/diag_dump_states.php b/src/usr/local/www/diag_dump_states.php index 0ca467d..1010f45 100644 --- a/src/usr/local/www/diag_dump_states.php +++ b/src/usr/local/www/diag_dump_states.php @@ -237,10 +237,14 @@ print $form; $arr[] = array("filter" => $_POST['filter']); } - if (count($arr) > 0) { - $res = pfSense_get_pf_states($arr); + if (isset($_POST['filter']) || !isset($config['system']['webgui']['requirestatefilter'])) { + if (count($arr) > 0) { + $res = pfSense_get_pf_states($arr); + } else { + $res = pfSense_get_pf_states(); + } } else { - $res = pfSense_get_pf_states(); + $res = NULL; } $states = 0; @@ -298,6 +302,9 @@ print $form; if ($states == 0) { if (isset($_POST['filter']) && !empty($_POST['filter'])) { $errmsg = gettext('No states were found that match the current filter.'); + } else if (!isset($_POST['filter']) && isset($config['system']['webgui']['requirestatefilter'])) { + $errmsg = gettext('State display suppressed without filter submission. '. + 'See System > General, Require State Filter.'); } else { $errmsg = gettext('No states were found.'); } diff --git a/src/usr/local/www/system.php b/src/usr/local/www/system.php index 0b1f57a..c21c67a 100644 --- a/src/usr/local/www/system.php +++ b/src/usr/local/www/system.php @@ -100,6 +100,7 @@ $pconfig['webguihostnamemenu'] = $config['system']['webgui']['webguihostnamemenu $pconfig['dnslocalhost'] = isset($config['system']['dnslocalhost']); $pconfig['dashboardperiod'] = isset($config['widgets']['period']) ? $config['widgets']['period']:"10"; $pconfig['loginshowhost'] = isset($config['system']['webgui']['loginshowhost']); +$pconfig['requirestatefilter'] = isset($config['system']['webgui']['requirestatefilter']); if (!$pconfig['timezone']) { if (isset($g['default_timezone']) && !empty($g['default_timezone'])) { @@ -209,6 +210,8 @@ if ($_POST) { unset($config['system']['webgui']['dashboardcolumns']); } + $config['system']['webgui']['requirestatefilter'] = $_POST['requirestatefilter'] ? true : false; + if ($_POST['hostname']) { if (!is_hostname($_POST['hostname'])) { $input_errors[] = gettext("The hostname can only contain the characters A-Z, 0-9 and '-'. It may not start or end with '-'."); @@ -552,6 +555,7 @@ gen_associatedpanels_fields( $pconfig['systemlogsfilterpanel'], $pconfig['systemlogsmanagelogpanel'], $pconfig['statusmonitoringsettingspanel']); +gen_requirestatefilter_field($section, $pconfig['requirestatefilter']); gen_webguileftcolumnhyper_field($section, $pconfig['webguileftcolumnhyper']); $section->addInput(new Form_Checkbox( |