diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-12-21 10:26:47 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-12-21 10:27:08 +0000 |
commit | b4deddce0ac94ef6feda97c4231863399e7fda03 (patch) | |
tree | 10bda7c1961274569ede80310b022ac2ab028f11 /usr/local | |
parent | 7321c93c81634a013937b6716f2ecf7917f5d638 (diff) | |
download | pfsense-b4deddce0ac94ef6feda97c4231863399e7fda03.zip pfsense-b4deddce0ac94ef6feda97c4231863399e7fda03.tar.gz |
Fix type handling to save what was choosen end not to guess it. Save the cidr when specified with hostnames seems people used this feature in 1.2.x branch.
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/firewall_aliases_edit.php | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index 6b02caf..a5eb4ce 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -95,6 +95,7 @@ if (isset($id) && $a_aliases[$id]) { $pconfig['name'] = $a_aliases[$id]['name']; $pconfig['detail'] = $a_aliases[$id]['detail']; $pconfig['address'] = $a_aliases[$id]['address']; + $pconfig['type'] = $a_aliases[$id]['type']; $pconfig['descr'] = html_entity_decode($a_aliases[$id]['descr']); /* optional if list */ @@ -103,20 +104,6 @@ if (isset($id) && $a_aliases[$id]) { if($ifdesc == $pconfig['descr']) $input_errors[] = "Sorry, an interface is already named {$pconfig['descr']}."; - $addresses = explode(' ', $pconfig['address']); - $address = explode("/", $addresses[0]); - if ($address[1]) - $addresssubnettest = true; - else - $addresssubnettest = false; - - if ($addresssubnettest) - $pconfig['type'] = "network"; - else - if (is_ipaddr($address[0])) - $pconfig['type'] = "host"; - else - $pconfig['type'] = "port"; if($a_aliases[$id]['aliasurl'] <> "") { $pconfig['type'] = "url"; @@ -239,7 +226,7 @@ if ($_POST) { if ($isfirst > 0) $address .= " "; $address .= $_POST["address{$x}"]; - if(is_ipaddr($_POST["address{$x}"]) && $_POST["address_subnet{$x}"] <> "") + if(($_POST['type'] == "network" || is_ipaddr($_POST["address{$x}"])) && $_POST["address_subnet{$x}"] <> "") $address .= "/" . $_POST["address_subnet{$x}"]; if($_POST["detail{$x}"] <> "") { |