diff options
author | Bill Marquette <billm@pfsense.org> | 2005-05-16 02:14:55 +0000 |
---|---|---|
committer | Bill Marquette <billm@pfsense.org> | 2005-05-16 02:14:55 +0000 |
commit | 4a9918899508c7c12aabd8e1d03a3c9ff6b83a83 (patch) | |
tree | 70023889810f93c2ed5dfd70e3643d4fdbebcbf9 /usr/local/www/firewall_nat_edit.php | |
parent | 98877b0c4fe8e577f16485680a93bf5edfecf697 (diff) | |
download | pfsense-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-x | usr/local/www/firewall_nat_edit.php | 15 |
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"> </td> <td width="78%"> |