diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-02-21 16:15:07 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-02-21 16:15:07 -0300 |
commit | 3202763c8bdd2cd6821be7bc21829085548cc504 (patch) | |
tree | 76cca24e8f4542d81ff6687a4145947d8a32ddbd | |
parent | 95540233e3b9d8c4be5616065edcc6e1f2e2f972 (diff) | |
download | pfsense-3202763c8bdd2cd6821be7bc21829085548cc504.zip pfsense-3202763c8bdd2cd6821be7bc21829085548cc504.tar.gz |
Add NAT rule based on NAT rule below it instead of at the bottom of the list. Fixes #1118
-rwxr-xr-x | usr/local/www/firewall_nat_edit.php | 16 | ||||
-rwxr-xr-x | usr/local/www/firewall_nat_out_edit.php | 9 |
2 files changed, 13 insertions, 12 deletions
diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php index 40ede55..f4b4587 100755 --- a/usr/local/www/firewall_nat_edit.php +++ b/usr/local/www/firewall_nat_edit.php @@ -60,6 +60,11 @@ $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']; @@ -365,16 +370,6 @@ if ($_POST) { $_POST['filter-rule-association']=='add-unassociated') ) $need_filter_rule = true; - // Determine NAT entry ID now, we need it for the firewall rule - if (isset($id) && $a_nat[$id]) - $a_nat[$id] = $natent; - else { - if (is_numeric($after)) - $id = $after + 1; - else - $id = count($a_nat); - } - if ($need_filter_rule == true) { /* auto-generate a matching firewall rule */ @@ -855,6 +850,7 @@ include("fbegin.inc"); ?> <?php if (isset($id) && $a_nat[$id]): ?> <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>"> <?php endif; ?> + <input name="after" type="hidden" value="<?=htmlspecialchars($after);?>"> </td> </tr> </table> diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php index b789e28..5552071 100755 --- a/usr/local/www/firewall_nat_out_edit.php +++ b/usr/local/www/firewall_nat_out_edit.php @@ -63,11 +63,15 @@ 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']; -} else - unset($after); +} if (isset($id) && $a_out[$id]) { $pconfig['protocol'] = $a_out[$id]['protocol']; @@ -661,6 +665,7 @@ any)");?></td> <?php if (isset($id) && $a_out[$id]): ?> <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>"> <?php endif; ?> + <input name="after" type="hidden" value="<?=htmlspecialchars($after);?>"> </td> </tr> </table> |