diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-11-20 15:20:01 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-11-20 15:20:01 -0200 |
commit | e924cd7eb2457e7fd7122aecc1f2887824229edb (patch) | |
tree | 3e7ff684e874de59cdb3b0e8e50632d4e02f006b /usr/local/www/firewall_nat_1to1_edit.php | |
parent | a0e1f0f1e3a50b3f1675d977ca16fdd123c7e857 (diff) | |
download | pfsense-e924cd7eb2457e7fd7122aecc1f2887824229edb.zip pfsense-e924cd7eb2457e7fd7122aecc1f2887824229edb.tar.gz |
Add hability to insert after, reorder, batch delete and enable/disable to 1:1 NAT rules. It fixes #3327
Diffstat (limited to 'usr/local/www/firewall_nat_1to1_edit.php')
-rwxr-xr-x | usr/local/www/firewall_nat_1to1_edit.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/usr/local/www/firewall_nat_1to1_edit.php b/usr/local/www/firewall_nat_1to1_edit.php index f8ad813..679df94 100755 --- a/usr/local/www/firewall_nat_1to1_edit.php +++ b/usr/local/www/firewall_nat_1to1_edit.php @@ -73,6 +73,15 @@ $id = $_GET['id']; if (isset($_POST['id'])) $id = $_POST['id']; +$after = $_GET['after']; +if (isset($_POST['after'])) + $after = $_POST['after']; + +if (isset($_GET['dup'])) { + $id = $_GET['dup']; + $after = $_GET['dup']; +} + if (isset($id) && $a_1to1[$id]) { $pconfig['disabled'] = isset($a_1to1[$id]['disabled']); @@ -94,6 +103,9 @@ if (isset($id) && $a_1to1[$id]) { } else $pconfig['interface'] = "wan"; +if (isset($_GET['dup'])) + unset($id); + if ($_POST) { unset($input_errors); @@ -206,8 +218,12 @@ if ($_POST) { if (isset($id) && $a_1to1[$id]) $a_1to1[$id] = $natent; - else - $a_1to1[] = $natent; + else { + if (is_numeric($after)) + array_splice($a_1to1, $after+1, 0, array($natent)); + else + $a_1to1[] = $natent; + } nat_1to1_rules_sort(); if (write_config()) |