From c805e0f35bc5030fdacb0d339649e72b2947009f Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 10 Mar 2014 19:39:39 -0700 Subject: [PATCH] Make Firewall Rules Advanced Options open if used - 2.1 branch This is the same code as pull request 997 but for 2.1 branch --- usr/local/www/firewall_rules_edit.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 24788d9055..d77fe23ea7 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -45,6 +45,23 @@ require("guiconfig.inc"); require_once("filter.inc"); require("shaper.inc"); +function is_aoadv_used($rule_config) { + // Note that the user could set "tag" or "tagged" to the string "0", which is valid but empty(). + if ((isset($rule_config['allowopts'])) || + (isset($rule_config['disablereplyto'])) || + ($rule_config['tag'] != "") || + ($rule_config['tagged'] != "") || + (!empty($rule_config['max'])) || + (!empty($rule_config['max-src-nodes'])) || + (!empty($rule_config['max-src-conn'])) || + (!empty($rule_config['max-src-states'])) || + (!empty($rule_config['max-src-conn-rate'])) || + (!empty($rule_config['max-src-conn-rates'])) || + (!empty($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) { @@ -1230,10 +1247,10 @@ $i--): ?> -
+
> " /> -
-