summaryrefslogtreecommitdiffstats
path: root/usr/local/www/firewall_nat_edit.php
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2005-05-16 02:14:55 +0000
committerBill Marquette <billm@pfsense.org>2005-05-16 02:14:55 +0000
commit4a9918899508c7c12aabd8e1d03a3c9ff6b83a83 (patch)
tree70023889810f93c2ed5dfd70e3643d4fdbebcbf9 /usr/local/www/firewall_nat_edit.php
parent98877b0c4fe8e577f16485680a93bf5edfecf697 (diff)
downloadpfsense-4a9918899508c7c12aabd8e1d03a3c9ff6b83a83.zip
pfsense-4a9918899508c7c12aabd8e1d03a3c9ff6b83a83.tar.gz
Ticket 6: Allow NAT to duplicate rules
Diffstat (limited to 'usr/local/www/firewall_nat_edit.php')
-rwxr-xr-xusr/local/www/firewall_nat_edit.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php
index 847be62..75f6c11 100755
--- a/usr/local/www/firewall_nat_edit.php
+++ b/usr/local/www/firewall_nat_edit.php
@@ -42,6 +42,11 @@ $id = $_GET['id'];
if (isset($_POST['id']))
$id = $_POST['id'];
+if (isset($_GET['dup'])) {
+ $id = $_GET['dup'];
+ $after = $_GET['dup'];
+}
+
if (isset($id) && $a_nat[$id]) {
$pconfig['extaddr'] = $a_nat[$id]['external-address'];
$pconfig['proto'] = $a_nat[$id]['protocol'];
@@ -141,8 +146,12 @@ if ($_POST) {
if (isset($id) && $a_nat[$id])
$a_nat[$id] = $natent;
- else
- $a_nat[] = $natent;
+ else {
+ if (is_numeric($after))
+ array_splice($a_nat, $after+1, 0, array($natent));
+ else
+ $a_nat[] = $natent;
+ }
touch($d_natconfdirty_path);
@@ -338,7 +347,7 @@ function ext_rep_change() {
<input name="descr" type="text" class="formfld" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
<br> <span class="vexpl">You may enter a description here
for your reference (not parsed).</span></td>
- </tr><?php if (!(isset($id) && $a_nat[$id])): ?>
+ </tr><?php if ((!(isset($id) && $a_nat[$id])) || (isset($_GET['dup']))): ?>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
OpenPOWER on IntegriCloud