summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2014-02-28 00:10:32 -0800
committerPhil Davis <phil.davis@inf.org>2014-02-28 00:10:32 -0800
commitb612c49f5eefbbfa4b671a13fdc1f0a70a58faac (patch)
tree816972011450b52ac7fee85dd12cbcdbce51f466
parentc67088333833ee64460641e55295ea3d9ff413cb (diff)
downloadpfsense-b612c49f5eefbbfa4b671a13fdc1f0a70a58faac.zip
pfsense-b612c49f5eefbbfa4b671a13fdc1f0a70a58faac.tar.gz
Use return_gateway_groups_array() to build correct GWG list
Version for 2.1 branch
-rwxr-xr-xusr/local/www/firewall_rules_edit.php17
1 files changed, 7 insertions, 10 deletions
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php
index ad4077e..1a80ffa 100755
--- a/usr/local/www/firewall_rules_edit.php
+++ b/usr/local/www/firewall_rules_edit.php
@@ -202,6 +202,7 @@ read_dummynet_config(); /* XXX: */
$dnqlist =& get_unique_dnqueue_list();
read_layer7_config();
$l7clist =& get_l7_unique_list();
+$a_gatewaygroups = return_gateway_groups_array();
if ($_POST) {
unset($input_errors);
@@ -213,7 +214,6 @@ if ($_POST) {
}
if (($_POST['ipprotocol'] <> "") && ($_POST['gateway'] <> "")) {
- $a_gatewaygroups = return_gateway_groups_array();
if(is_array($config['gateways']['gateway_group'])) {
foreach($config['gateways']['gateway_group'] as $gw_group) {
if($gw_group['name'] == $_POST['gateway']) {
@@ -1453,23 +1453,20 @@ $i--): ?>
echo "<option value=\"{$gwname}\" {$selected}>{$gw['name']} - {$gw['gateway']}</option>\n";
}
/* add gateway groups to the list */
- if (is_array($config['gateways']['gateway_group'])) {
- foreach($config['gateways']['gateway_group'] as $gw_group) {
- $af = explode("|", $gw_group['item'][0]);
+ if (is_array($a_gatewaygroups)) {
+ foreach($a_gatewaygroups as $gwg_name => $gwg_data) {
if(($pconfig['ipprotocol'] == "inet46"))
continue;
- if(($pconfig['ipprotocol'] == "inet6") && !is_ipaddrv6(lookup_gateway_ip_by_name($af[0])))
+ if(($pconfig['ipprotocol'] == "inet6") && ($gwg_data['ipprotocol'] != "inet6"))
continue;
- if(($pconfig['ipprotocol'] == "inet") && !is_ipaddrv4(lookup_gateway_ip_by_name($af[0])))
+ if(($pconfig['ipprotocol'] == "inet") && ($gwg_data['ipprotocol'] != "inet"))
continue;
- if($gw_group['name'] == "")
- continue;
- if($pconfig['gateway'] == $gw_group['name']) {
+ if($pconfig['gateway'] == $gwg_name) {
$selected = " selected=\"selected\"";
} else {
$selected = "";
}
- echo "<option value=\"{$gw_group['name']}\" $selected>{$gw_group['name']}</option>\n";
+ echo "<option value=\"{$gwg_name}\" $selected>{$gwg_name}</option>\n";
}
}
?>
OpenPOWER on IntegriCloud