diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2011-02-04 06:20:58 -0700 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2011-02-04 06:20:58 -0700 |
commit | 6a97db1ccd854d41801dcc5d51162f32f9a9d45c (patch) | |
tree | f147f6df94d6139316edafe17c92f0daa66c000e /usr/local | |
parent | 9f1e3b2b33ced0cba1abc36387abd1c134e5216f (diff) | |
download | pfsense-6a97db1ccd854d41801dcc5d51162f32f9a9d45c.zip pfsense-6a97db1ccd854d41801dcc5d51162f32f9a9d45c.tar.gz |
Allow aliases to be entered for source and destination addresses of outbound NAT rules.
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/firewall_nat_out_edit.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php index c0308bb..91c2ff9 100755 --- a/usr/local/www/firewall_nat_out_edit.php +++ b/usr/local/www/firewall_nat_out_edit.php @@ -132,7 +132,7 @@ if ($_POST) { $input_errors[] = gettext("You must supply either a valid port for the nat port entry."); if ($_POST['source_type'] != "any") { - if ($_POST['source'] && !is_ipaddr($_POST['source']) && $_POST['source'] <> "any") { + if ($_POST['source'] && !is_ipaddroralias($_POST['source']) && $_POST['source'] <> "any") { $input_errors[] = gettext("A valid source must be specified."); } } @@ -140,7 +140,7 @@ if ($_POST) { $input_errors[] = gettext("A valid source bit count must be specified."); } if ($_POST['destination_type'] != "any") { - if ($_POST['destination'] && !is_ipaddr($_POST['destination'])) { + if ($_POST['destination'] && !is_ipaddroralias($_POST['destination'])) { $input_errors[] = gettext("A valid destination must be specified."); } } @@ -182,6 +182,8 @@ if ($_POST) { /* if user has selected any as source, set it here */ if($_POST['source_type'] == "any") { $osn = "any"; + } else if(is_alias($_POST['source'])) { + $osn = $_POST['source']; } else { $osn = gen_subnet($_POST['source'], $_POST['source_subnet']) . "/" . $_POST['source_subnet']; } @@ -189,6 +191,8 @@ if ($_POST) { /* check for existing entries */ if ($_POST['destination_type'] == "any") { $ext = "any"; + } else if(is_alias($_POST['destination'])) { + $ext = $_POST['destination']; } else { $ext = gen_subnet($_POST['destination'], $_POST['destination_subnet']) . "/" . $_POST['destination_subnet']; } |