diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-05-31 18:55:31 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-05-31 18:55:31 +0000 |
commit | d2b26274d0651073f1c040e534bfc085ac235e73 (patch) | |
tree | cc3e99b89d06586294ff85c0cabe5a879ef46dfa /usr/local/www/firewall_nat_out_edit.php | |
parent | 0b45817624a00f0ea7d0767f509b62a292f530a0 (diff) | |
download | pfsense-d2b26274d0651073f1c040e534bfc085ac235e73.zip pfsense-d2b26274d0651073f1c040e534bfc085ac235e73.tar.gz |
Add source Type dropdown box allowing the user to select "any" as the source
Diffstat (limited to 'usr/local/www/firewall_nat_out_edit.php')
-rwxr-xr-x | usr/local/www/firewall_nat_out_edit.php | 34 |
1 files 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; + } +} //--> </script> </head> @@ -242,7 +265,14 @@ function typesel_change() { <td width="78%" class="vtable"> <table border="0" cellspacing="0" cellpadding="0"> <tr> - <td>Address: </td + <td>Type: </td> + <td> + <select name="source_type" class="formfld" onChange="sourcesel_change()"> + <option value="any" <?php if ($pconfig['source'] == "any") echo "selected"; ?>>any</option> + <option value="network" <?php if ($pconfig['source'] != "any") echo "selected"; ?>>Network</option> + </select> + </td></tr> + <td>Address: </td> <td><input name="source" type="text" class="formfld" id="source" size="20" value="<?=htmlspecialchars($pconfig['source']);?>">/<select name="source_subnet" class="formfld" id="source_subnet"> <?php for ($i = 32; $i >= 0; $i--): ?> <option value="<?=$i;?>" <?php if ($i == $pconfig['source_subnet']) echo "selected"; ?>> |