From 645eb5329dbc88d68506ddc9610399eee9e79281 Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Wed, 24 Aug 2005 01:18:49 +0000 Subject: Allow any to be used for source address --- usr/local/www/firewall_nat_out_edit.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php index 114f5a1..ea8ef59 100755 --- a/usr/local/www/firewall_nat_out_edit.php +++ b/usr/local/www/firewall_nat_out_edit.php @@ -78,6 +78,10 @@ if ($_POST) { $_POST['destination'] = "any"; $_POST['destination_subnet'] = 24; } + if ($_POST['source_type'] == "any") { + $_POST['source'] = "any"; + $_POST['source_subnet'] = 24; + } unset($input_errors); $pconfig = $_POST; @@ -88,11 +92,13 @@ if ($_POST) { do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - if ($_POST['source'] && !is_ipaddr($_POST['source']) && $_POST['source'] <> "any") { - $input_errors[] = "A valid source must be specified."; - } - if ($_POST['source_subnet'] && !is_numericint($_POST['source_subnet'])) { - $input_errors[] = "A valid source bit count must be specified."; + if ($_POST['source_type'] != "any") { + if ($_POST['source'] && !is_ipaddr($_POST['source']) && $_POST['source'] <> "any") { + $input_errors[] = "A valid source must be specified."; + } + if ($_POST['source_subnet'] && !is_numericint($_POST['source_subnet'])) { + $input_errors[] = "A valid source bit count must be specified."; + } } if ($_POST['sourceport'] && !is_numericint($_POST['sourceport'])) { $input_errors[] = "A valid source port must be specified."; -- cgit v1.1