diff options
author | Bill Marquette <billm@pfsense.org> | 2005-05-16 02:29:08 +0000 |
---|---|---|
committer | Bill Marquette <billm@pfsense.org> | 2005-05-16 02:29:08 +0000 |
commit | 124b1b858ed07a26333e8ce5c71f2cdb73a45a6f (patch) | |
tree | c38c45c52f8e7623eab6c81aa7a979a585fa25ea /usr | |
parent | f449d83ebf66288c2676b12df951fd9c0b602269 (diff) | |
download | pfsense-124b1b858ed07a26333e8ce5c71f2cdb73a45a6f.zip pfsense-124b1b858ed07a26333e8ce5c71f2cdb73a45a6f.tar.gz |
Ticket #6: Allow for NAT rule duplication (adv. outbound nat this round)
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/firewall_nat_out.php | 2 | ||||
-rwxr-xr-x | usr/local/www/firewall_nat_out_edit.php | 23 |
2 files changed, 17 insertions, 8 deletions
diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php index ca0adf4..058b87d 100755 --- a/usr/local/www/firewall_nat_out.php +++ b/usr/local/www/firewall_nat_out.php @@ -284,7 +284,7 @@ if (isset($_POST['del_x'])) { </tr> <tr> <td><input onmouseover="fr_insline(<?=$nnats;?>, true)" onmouseout="fr_insline(<?=$nnats;?>, false)" name="move_<?=$i;?>" src="left.gif" title="move selected rules before this rule" height="17" type="image" width="17" border="0"></td> - <!-- <billm><td><a href="firewall_nat_out_edit.php?dup=<?=$i;?>"><img src="plus.gif" title="add a new nat based on this one" width="17" height="17" border="0"></a></td><billm> --> + <td><a href="firewall_nat_out_edit.php?dup=<?=$i;?>"><img src="plus.gif" title="add a new nat based on this one" width="17" height="17" border="0"></a></td> </tr> </table> <?php $i++; $nnats++; endforeach; ?> diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php index c0b0b17..807efab 100755 --- a/usr/local/www/firewall_nat_out_edit.php +++ b/usr/local/www/firewall_nat_out_edit.php @@ -35,21 +35,26 @@ require("guiconfig.inc"); if (!is_array($config['nat']['advancedoutbound']['rule'])) - $config['nat']['advancedoutbound']['rule'] = array(); + $config['nat']['advancedoutbound']['rule'] = array(); $a_out = &$config['nat']['advancedoutbound']['rule']; //nat_out_rules_sort(); $id = $_GET['id']; if (isset($_POST['id'])) - $id = $_POST['id']; + $id = $_POST['id']; + +if (isset($_GET['dup'])) { + $id = $_GET['dup']; + $after = $_GET['dup']; +} if (isset($id) && $a_out[$id]) { list($pconfig['source'],$pconfig['source_subnet']) = explode('/', $a_out[$id]['source']['network']); $pconfig['sourceport'] = $a_out[$id]['sourceport']; address_to_pconfig($a_out[$id]['destination'], $pconfig['destination'], $pconfig['destination_subnet'], $pconfig['destination_not'], - null, null); + $none, $none); $pconfig['natport'] = $a_out[$id]['natport']; $pconfig['target'] = $a_out[$id]['target']; $pconfig['interface'] = $a_out[$id]['interface']; @@ -164,10 +169,14 @@ if ($_POST) { if (isset($_POST['destination_not']) && $ext != "any") $natent['destination']['not'] = true; - if (isset($id) && $a_out[$id]) - $a_out[$id] = $natent; - else - $a_out[] = $natent; + if (isset($id) && $a_nat[$id]) + $a_nat[$id] = $natent; + else { + if (is_numeric($after)) + array_splice($a_nat, $after+1, 0, array($natent)); + else + $a_nat[] = $natent; + } touch($d_natconfdirty_path); |