summaryrefslogtreecommitdiffstats
path: root/usr/local/www/firewall_nat_out_edit.php
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2011-02-13 09:20:15 -0700
committerErik Fonnesbeck <efonnes@gmail.com>2011-02-13 09:27:51 -0700
commitca640261f33d5489d44a8bbc37d875d9986cf34f (patch)
tree2159307325a83e0b56ebca2e06b44b3c8846018e /usr/local/www/firewall_nat_out_edit.php
parentd164643a3560174bf1caabef4649b5b2a382b8ff (diff)
downloadpfsense-ca640261f33d5489d44a8bbc37d875d9986cf34f.zip
pfsense-ca640261f33d5489d44a8bbc37d875d9986cf34f.tar.gz
Add alias support for source and destination ports on outbound NAT.
Diffstat (limited to 'usr/local/www/firewall_nat_out_edit.php')
-rwxr-xr-xusr/local/www/firewall_nat_out_edit.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php
index fc71a08..db6d03d 100755
--- a/usr/local/www/firewall_nat_out_edit.php
+++ b/usr/local/www/firewall_nat_out_edit.php
@@ -124,14 +124,14 @@ if ($_POST) {
$protocol_uses_ports = in_array($_POST['protocol'], explode(" ", "any tcp udp tcp/udp"));
- if($protocol_uses_ports && $_POST['sourceport'] <> "" && !is_port($_POST['sourceport']))
- $input_errors[] = gettext("You must supply either a valid port for the source port entry.");
+ if($protocol_uses_ports && $_POST['sourceport'] <> "" && !is_portoralias($_POST['sourceport']))
+ $input_errors[] = gettext("You must supply either a valid port or port alias for the source port entry.");
- if($protocol_uses_ports and $_POST['dstport'] <> "" and !is_port($_POST['dstport']))
- $input_errors[] = gettext("You must supply either a valid port for the destination port entry.");
+ if($protocol_uses_ports and $_POST['dstport'] <> "" and !is_portoralias($_POST['dstport']))
+ $input_errors[] = gettext("You must supply either a valid port or port alias for the destination port entry.");
if($protocol_uses_ports and $_POST['natport'] <> "" and !is_port($_POST['natport']) and !isset($_POST['nonat']))
- $input_errors[] = gettext("You must supply either a valid port for the nat port entry.");
+ $input_errors[] = gettext("You must supply a valid port for the nat port entry.");
if ($_POST['source_type'] != "any") {
if ($_POST['source'] && !is_ipaddroralias($_POST['source']) && $_POST['source'] <> "any") {
@@ -470,7 +470,7 @@ function poolopts_change() {
</tr>
<tr name="sport_tr" id="sport_tr">
<td><?=gettext("Source port:");?>&nbsp;&nbsp;</td>
- <td><input name="sourceport" type="text" class="formfld unknown" id="sourceport" size="5" value="<?=htmlspecialchars($pconfig['sourceport']);?>"> <?=gettext("(leave
+ <td><input name="sourceport" type="text" autocomplete="off" class="formfldalias" id="sourceport" size="5" value="<?=htmlspecialchars($pconfig['sourceport']);?>"> <?=gettext("(leave
blank for any)");?></td>
</tr>
</table></td>
@@ -509,7 +509,7 @@ blank for any)");?></td>
</tr>
<tr name="dport_tr" id="dport_tr">
<td><?=gettext("Destination port:");?>&nbsp;&nbsp;</td>
- <td><input name="dstport" type="text" class="formfld unknown" id="dstport" size="5" value="<?=htmlspecialchars($pconfig['dstport']);?>"> <?=gettext("(leave blank for
+ <td><input name="dstport" type="text" autocomplete="off" class="formfldalias" id="dstport" size="5" value="<?=htmlspecialchars($pconfig['dstport']);?>"> <?=gettext("(leave blank for
any)");?></td>
</tr>
</table>
@@ -671,7 +671,9 @@ poolopts_change();
var customarray=new Array(<?php echo $portaliases; ?>);
var oTextbox1 = new AutoSuggestControl(document.getElementById("source"), new StateSuggestions(addressarray));
- var oTextbox2 = new AutoSuggestControl(document.getElementById("destination"), new StateSuggestions(addressarray));
+ var oTextbox2 = new AutoSuggestControl(document.getElementById("sourceport"), new StateSuggestions(customarray));
+ var oTextbox3 = new AutoSuggestControl(document.getElementById("destination"), new StateSuggestions(addressarray));
+ var oTextbox4 = new AutoSuggestControl(document.getElementById("dstport"), new StateSuggestions(customarray));
//-->
</script>
<?php include("fend.inc"); ?>
OpenPOWER on IntegriCloud