From d2b26274d0651073f1c040e534bfc085ac235e73 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 31 May 2005 18:55:31 +0000 Subject: Add source Type dropdown box allowing the user to select "any" as the source --- usr/local/www/firewall_nat_out_edit.php | 34 +++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php index e713fe3..df85b25 100755 --- a/usr/local/www/firewall_nat_out_edit.php +++ b/usr/local/www/firewall_nat_out_edit.php @@ -113,8 +113,14 @@ if ($_POST) { $input_errors[] = "A valid target IP address must be specified."; } + /* if user has selected any as source, set it here */ + if($_POST['source_type'] == "any") { + $osn = "any"; + } else { + $osn = gen_subnet($_POST['source'], $_POST['source_subnet']) . "/" . $_POST['source_subnet']; + } + /* check for existing entries */ - $osn = gen_subnet($_POST['source'], $_POST['source_subnet']) . "/" . $_POST['source_subnet']; if ($_POST['destination_type'] == "any") $ext = "any"; else @@ -209,6 +215,23 @@ function typesel_change() { break; } } +function sourcesel_change() { + switch (document.iform.source_type.selectedIndex) { + case 1: // network + document.iform.source.disabled = 0; + document.iform.source.disabled = 0; + document.iform.sourceport.disabled = 0; + break; + default: + document.iform.source.value = ""; + document.iform.sourceport.value = ""; + document.iform.sourceport.disabled = 1; + document.iform.source.disabled = 1; + document.iform.source_subnet.value = "24"; + document.iform.source_subnet.disabled = 1; + break; + } +} //--> @@ -242,7 +265,14 @@ function typesel_change() { - Type:   + +
Address:   + +
Address:   /