From 088a4eed18e192c7577ce79406fc914a9b4a708a Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Fri, 28 Feb 2014 06:00:46 -0800 Subject: Tidy up GWG dropdown selection tests Tested this making a new rule, and editing existing IPv4, IPv6 and IPv4+Ipv6 rules, and switching the IP version on an existing rule. Seems to work! --- usr/local/www/firewall_rules_edit.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'usr/local/www/firewall_rules_edit.php') diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index daa5d11..9020ac0 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -1474,18 +1474,14 @@ $i--): ?> /* add gateway groups to the list */ if (is_array($a_gatewaygroups)) { foreach($a_gatewaygroups as $gwg_name => $gwg_data) { - if(($pconfig['ipprotocol'] == "inet46")) - continue; - if(($pconfig['ipprotocol'] == "inet6") && ($gwg_data['ipprotocol'] != "inet6")) - continue; - if(($pconfig['ipprotocol'] == "inet") && ($gwg_data['ipprotocol'] != "inet")) - continue; - if($pconfig['gateway'] == $gwg_name) { - $selected = " selected=\"selected\""; - } else { - $selected = ""; + if((empty($pconfig['ipprotocol'])) || ($pconfig['ipprotocol'] == $gwg_data['ipprotocol'])) { + if($pconfig['gateway'] == $gwg_name) { + $selected = " selected=\"selected\""; + } else { + $selected = ""; + } + echo "\n"; } - echo "\n"; } } ?> -- cgit v1.1