diff options
author | Renato Botelho <garga@pfSense.org> | 2014-03-04 10:03:11 -0300 |
---|---|---|
committer | Renato Botelho <garga@pfSense.org> | 2014-03-04 10:03:11 -0300 |
commit | ebe2b407b330ef3ad32600c36da9752d162e3681 (patch) | |
tree | 1bc42cc51a28fd73a79b8baa7eca3eca702614d0 /usr/local | |
parent | faddd381089b93443f9fe52235818bd8f2d793f9 (diff) | |
parent | 088a4eed18e192c7577ce79406fc914a9b4a708a (diff) | |
download | pfsense-ebe2b407b330ef3ad32600c36da9752d162e3681.zip pfsense-ebe2b407b330ef3ad32600c36da9752d162e3681.tar.gz |
Merge pull request #984 from phil-davis/master
Return GWG IP protocol (version) when no gateway IP
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/firewall_rules_edit.php | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 7430b0e..f2c3479 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -205,6 +205,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); @@ -216,7 +217,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']) { @@ -1468,26 +1468,20 @@ $i--): ?> } else { $selected = ""; } - echo "<option value=\"{$gwname}\" {$selected}>{$gw['name']} - {$gw['gateway']}</option>\n"; + $gateway_addr_str = empty($gw['gateway']) ? "" : " - " . $gw[gateway]; + echo "<option value=\"{$gwname}\" {$selected}>{$gw['name']}{$gateway_addr_str}</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(($pconfig['ipprotocol'] == "inet46")) - continue; - if(($pconfig['ipprotocol'] == "inet6") && !is_ipaddrv6(lookup_gateway_ip_by_name($af[0]))) - continue; - if(($pconfig['ipprotocol'] == "inet") && !is_ipaddrv4(lookup_gateway_ip_by_name($af[0]))) - continue; - if($gw_group['name'] == "") - continue; - if($pconfig['gateway'] == $gw_group['name']) { - $selected = " selected=\"selected\""; - } else { - $selected = ""; + if (is_array($a_gatewaygroups)) { + foreach($a_gatewaygroups as $gwg_name => $gwg_data) { + if((empty($pconfig['ipprotocol'])) || ($pconfig['ipprotocol'] == $gwg_data['ipprotocol'])) { + if($pconfig['gateway'] == $gwg_name) { + $selected = " selected=\"selected\""; + } else { + $selected = ""; + } + echo "<option value=\"{$gwg_name}\" $selected>{$gwg_name}</option>\n"; } - echo "<option value=\"{$gw_group['name']}\" $selected>{$gw_group['name']}</option>\n"; } } ?> |