diff options
author | Phil Davis <phil.davis@inf.org> | 2016-03-10 12:41:09 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2016-03-10 12:41:09 +0545 |
commit | f7e3a67f58cca66642fe7c405d4a059064e77504 (patch) | |
tree | c1dfc7f72d19fcba75889c12f6aad7177c57cc04 /src/usr/local/www/firewall_rules_edit.php | |
parent | 05e539afbad4e79143ddf499c5f827db63471d22 (diff) | |
download | pfsense-f7e3a67f58cca66642fe7c405d4a059064e77504.zip pfsense-f7e3a67f58cca66642fe7c405d4a059064e77504.tar.gz |
Improve test for firewall rule advanced setting
You could make some advanced settings, save the firewall rule, then when editing again the advanced section would not be automatically open. That makes it hard for users to realise that a rule has some advanced setting(s).
This change enhances function is_aoadv_used() so it checks all the things that are an advanced setting.
Diffstat (limited to 'src/usr/local/www/firewall_rules_edit.php')
-rw-r--r-- | src/usr/local/www/firewall_rules_edit.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index c7675ef..3dd4bfa 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -82,7 +82,9 @@ function is_posnumericint($arg) { function is_aoadv_used($rule_config) { // Note that the user could set "tag" or "tagged" to the string "0", which is valid but empty(). // And if the user enters "0" in other fields, we want to present an error message, and keep the Advanced Options section open. - if ((isset($rule_config['allowopts'])) || + if (($rule_config['os'] != "") || + ($rule_config['dscp'] != "") || + (isset($rule_config['allowopts'])) || (isset($rule_config['disablereplyto'])) || ($rule_config['tag'] != "") || ($rule_config['tagged'] != "") || @@ -92,7 +94,21 @@ function is_aoadv_used($rule_config) { ($rule_config['max-src-states'] != "") || ($rule_config['max-src-conn-rate'] != "") || ($rule_config['max-src-conn-rates'] != "") || - ($rule_config['statetimeout'] != "")) { + ($rule_config['statetimeout'] != "") || + ($rule_config['tcpflags1'] != "") || + ($rule_config['tcpflags2'] != "") || + ($rule_config['tcpflags_any']) || + ($rule_config['nopfsync']) || + (($rule_config['statetype'] != "") && ($rule_config['statetype'] != "keep state")) || + ($rule_config['nosync']) || + ($rule_config['vlanprio'] != "") || + ($rule_config['vlanprioset'] != "") || + ($rule_config['sched'] != "") || + ($rule_config['gateway'] != "") || + ($rule_config['dnpipe'] != "") || + ($rule_config['pdnpipe'] != "") || + ($rule_config['ackqueue'] != "") || + ($rule_config['defaultqueue'] != "")) { return true; } |