diff options
author | Bill Marquette <billm@pfsense.org> | 2005-09-04 05:19:29 +0000 |
---|---|---|
committer | Bill Marquette <billm@pfsense.org> | 2005-09-04 05:19:29 +0000 |
commit | d89924da0b4ffeef4b445254e2df24eb94c6d777 (patch) | |
tree | c9d0e7776054286d26c50f77a1506a5a88ab20a1 /usr | |
parent | 93a48ed86af5e5717b2020188736bea2bec34e36 (diff) | |
download | pfsense-d89924da0b4ffeef4b445254e2df24eb94c6d777.zip pfsense-d89924da0b4ffeef4b445254e2df24eb94c6d777.tar.gz |
(#355) Fix type detection - networks should now be recognized as networks
ports as ports, hosts as hosts...etc
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/firewall_aliases_edit.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index e980fd3..695051e 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -46,12 +46,21 @@ if (isset($_POST['id'])) if (isset($id) && $a_aliases[$id]) { $pconfig['name'] = $a_aliases[$id]['name']; + $addresses = explode(' ', $a_aliases[$id]['address']); + if (is_array($addresses)) + $address = $addresses[0]; + else + $address = $addresses; list($pconfig['address'],$pconfig['address_subnet']) = - explode('/', $a_aliases[$id]['address']); + explode('/', $address); if ($pconfig['address_subnet']) $pconfig['type'] = "network"; else - $pconfig['type'] = "host"; + if (is_ipaddr($pconfig['address'])) + $pconfig['type'] = "host"; + else + $pconfig['type'] = "port"; + $pconfig['descr'] = $a_aliases[$id]['descr']; } @@ -166,13 +175,13 @@ function typesel_change() { case 1: /* network */ var cmd; document.iform.address_subnet.disabled = 0; - document.iform.address_subnet.value = ""; +// document.iform.address_subnet.value = ""; newrows = totalrows+1; for(i=2; i<newrows; i++) { comd = 'document.iform.address_subnet' + i + '.disabled = 0;'; eval(comd); - comd = 'document.iform.address_subnet' + i + '.value = "32";'; - eval(comd); +// comd = 'document.iform.address_subnet' + i + '.value = "32";'; +// eval(comd); } break; case 2: /* port */ @@ -196,11 +205,11 @@ function update_box_type() { if(selected == 'Network(s)') { document.getElementById ("addressnetworkport").firstChild.data = "Network(s)"; document.getElementById ("address_subnet").visible = true; - document.getElementById ("address_subnet").disabled = true; + document.getElementById ("address_subnet").disabled = false; } else if(selected == 'Host(s)') { document.getElementById ("addressnetworkport").firstChild.data = "Host(s)"; document.getElementById ("address_subnet").visible = false; - document.getElementById ("address_subnet").disabled = false; + document.getElementById ("address_subnet").disabled = true; } else if(selected == 'Port(s)') { document.getElementById ("addressnetworkport").firstChild.data = "Port(s)"; document.getElementById ("address_subnet").visible = false; @@ -322,6 +331,7 @@ rows = 1; totalrows = <?php echo $counter; ?>; loaded = <?php echo $counter; ?>; typesel_change(); +update_box_type(); //--> </script> |