summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorRenato Botelho <garga@pfSense.org>2014-03-10 17:17:13 -0300
committerRenato Botelho <garga@pfSense.org>2014-03-10 17:17:13 -0300
commit11e4dcc72f235368eb827e040413e70e86014602 (patch)
tree26677bd3a3c787102e88a4884502fbdf2294bf22 /usr
parente6b1b1c15f21b32506df04a8331d7edb532b8202 (diff)
parentcd962bb9ef47da7d6dece0587a92694d599d2314 (diff)
downloadpfsense-11e4dcc72f235368eb827e040413e70e86014602.zip
pfsense-11e4dcc72f235368eb827e040413e70e86014602.tar.gz
Merge pull request #991 from phil-davis/RELENG_2_1
Return GWG IP protocol (version) when no gateway IP - 2.1 version
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/firewall_rules_edit.php30
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 033770b..24788d9 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']) {
@@ -1450,26 +1450,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";
}
}
?>
OpenPOWER on IntegriCloud