summaryrefslogtreecommitdiffstats
path: root/usr/local/www/firewall_nat_out_edit.php
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-12-08 15:40:08 +0000
committerErmal Luçi <eri@pfsense.org>2009-12-08 15:40:28 +0000
commit1ddb870bc83df15bf2322c9b28d196106e518101 (patch)
tree843ca88886c9b4ebc8ff29267d437a5609106f65 /usr/local/www/firewall_nat_out_edit.php
parent070a82a9df5054f2b6c8a30a3143645bf903b500 (diff)
downloadpfsense-1ddb870bc83df15bf2322c9b28d196106e518101.zip
pfsense-1ddb870bc83df15bf2322c9b28d196106e518101.tar.gz
Ticket #140 Fix Outbound edit page to really show errors. Propperly generate rules when switching from/to AON.
Diffstat (limited to 'usr/local/www/firewall_nat_out_edit.php')
-rwxr-xr-xusr/local/www/firewall_nat_out_edit.php26
1 files changed, 10 insertions, 16 deletions
diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php
index 0cbd44a..8083a3c 100755
--- a/usr/local/www/firewall_nat_out_edit.php
+++ b/usr/local/www/firewall_nat_out_edit.php
@@ -62,7 +62,8 @@ if (isset($_POST['id'])) {
if (isset($_GET['dup'])) {
$id = $_GET['dup'];
$after = $_GET['dup'];
-}
+} else
+ unset($after);
if (isset($id) && $a_out[$id]) {
list($pconfig['source'],$pconfig['source_subnet']) = explode('/', $a_out[$id]['source']['network']);
@@ -111,13 +112,13 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
- if($_POST['sourceport'] <> "" and !is_numericint($_POST['sourceport']))
+ if($_POST['sourceport'] <> "" && !is_port($_POST['sourceport']))
$input_errors[] = "You must supply either a valid port for the source port entry.";
- if($_POST['dstport'] <> "" and !is_numericint($_POST['dstport']))
+ if($_POST['dstport'] <> "" and !is_port($_POST['dstport']))
$input_errors[] = "You must supply either a valid port for the destination port entry.";
- if($_POST['natport'] <> "" and !is_numericint($_POST['natport']))
+ if($_POST['natport'] <> "" and !is_port($_POST['natport']))
$input_errors[] = "You must supply either a valid port for the nat port entry.";
if ($_POST['source_type'] != "any") {
@@ -148,13 +149,6 @@ if ($_POST) {
if ($_POST['nonat'] && $_POST['staticnatport']) {
$input_errors[] = "Static port cannot be used with No NAT.";
}
- if ($_POST['dstport'] && !is_numericint($_POST['dstport'])) {
- $input_errors[] = "A valid destination port must be specified.";
- }
-
- if ($_POST['natport'] && !is_numericint($_POST['natport'])) {
- $input_errors[] = "A valid NAT port must be specified.";
- }
if ($_POST['target'] && !is_ipaddr($_POST['target'])) {
$input_errors[] = "A valid target IP address must be specified.";
@@ -262,12 +256,12 @@ if ($_POST) {
$a_out[] = $natent;
}
}
- }
- mark_subsystem_dirty('natconf');
- write_config();
- header("Location: firewall_nat_out.php");
- exit;
+ mark_subsystem_dirty('natconf');
+ write_config();
+ header("Location: firewall_nat_out.php");
+ exit;
+ }
}
$pgtitle = array("Firewall","NAT","Outbound","Edit");
OpenPOWER on IntegriCloud