mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Add NAT rule based on NAT rule below it instead of at the bottom of the list. Fixes #1118
This commit is contained in:
parent
95540233e3
commit
3202763c8b
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user