From bd9d6e0e354b6f753ac8f08b96598c5f203bf858 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 4 Mar 2014 21:29:33 -0800 Subject: Make Firewall Rules Advanced Options open if used Currently, if there are some settings defined in Firewall Rules Edit, Advanced Features, Advanced Options, the Advanced Options section is left minimized when the Firewall Edit screen is displayed. This makes it easy for a user to not notice that there are some Advanced Options settings. This change makes the Advanced Options section be displayed if any of the settings are defined, in the same way it is done for all the other Advanced Features sections. --- usr/local/www/firewall_rules_edit.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 9020ac0..7bbd8e9 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -45,6 +45,22 @@ require("guiconfig.inc"); require_once("filter.inc"); require("shaper.inc"); +function is_aoadv_used($rule_config) { + if (($rule_config['allowopts']) || + ($rule_config['disablereplyto']) || + ($rule_config['tag'] != "") || + ($rule_config['tagged'] != "") || + ($rule_config['max'] != "") || + ($rule_config['max-src-nodes'] != "") || + ($rule_config['max-src-conn'] != "") || + ($rule_config['max-src-states'] != "") || + ($rule_config['max-src-conn-rate'] != "") || + ($rule_config['max-src-conn-rates'] != "") || + ($rule_config['statetimeout'] != "")) + return true; + return false; +} + $specialsrcdst = explode(" ", "any pptp pppoe l2tp openvpn"); $ifdisp = get_configured_interface_with_descr(); foreach ($ifdisp as $kif => $kdescr) { @@ -1240,10 +1256,10 @@ $i--): ?> -
+
> " /> -
-