diff options
Diffstat (limited to 'src/usr/local/www/firewall_nat.php')
-rw-r--r-- | src/usr/local/www/firewall_nat.php | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/usr/local/www/firewall_nat.php b/src/usr/local/www/firewall_nat.php index c67c3cc..6c856a5 100644 --- a/src/usr/local/www/firewall_nat.php +++ b/src/usr/local/www/firewall_nat.php @@ -79,18 +79,20 @@ if (!is_array($config['nat']['rule'])) { $a_nat = &$config['nat']['rule']; /* update rule order, POST[rule] is an array of ordered IDs */ -if(array_key_exists('order-store', $_POST)) { +if (array_key_exists('order-store', $_POST)) { if (is_array($_POST['rule']) && !empty($_POST['rule'])) { $a_nat_new = array(); // if a rule is not in POST[rule], it has been deleted by the user - foreach ($_POST['rule'] as $id) + foreach ($_POST['rule'] as $id) { $a_nat_new[] = $a_nat[$id]; + } $a_nat = $a_nat_new; - if (write_config()) + if (write_config()) { mark_subsystem_dirty('filter'); + } header("Location: firewall_nat.php"); exit; @@ -171,12 +173,14 @@ $closehead = false; $pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("Port Forward")); include("head.inc"); -if ($savemsg) +if ($savemsg) { print_info_box($savemsg, 'success'); +} -if (is_subsystem_dirty('natconf')) +if (is_subsystem_dirty('natconf')) { print_info_box_np(gettext('The NAT configuration has been changed.') . '<br />' . gettext('You must apply the changes in order for them to take effect.') . '<br />'); +} $tab_array = array(); $tab_array[] = array(gettext("Port Forward"), true, "firewall_nat.php"); @@ -222,8 +226,9 @@ foreach ($a_nat as $natent): ); /* if user does not have access to edit an interface skip on to the next record */ - if (!have_natpfruleint_access($natent['interface'])) + if (!have_natpfruleint_access($natent['interface'])) { continue; + } ?> <tr id="fr<?=$nnats;?>" onClick="fr_toggle(<?=$nnats;?>)" ondblclick="document.location='firewall_nat_edit.php?id=<?=$i;?>';"> @@ -246,10 +251,11 @@ foreach ($a_nat as $natent): <td> <?=$textss?> <?php - if (!$natent['interface']) + if (!$natent['interface']) { echo htmlspecialchars(convert_friendly_interface_to_friendly_descr("wan")); - else + } else { echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface'])); + } ?> <?=$textse?> </td> @@ -353,7 +359,7 @@ foreach ($a_nat as $natent): <td> <a class="fa fa-pencil" title="<?=gettext("Edit rule"); ?>" href="firewall_nat_edit.php?id=<?=$i?>"></a> <a class="fa fa-clone" title="<?=gettext("Add a new NAT based on this one")?>" href="firewall_nat_edit.php?dup=<?=$i?>"></a> - <a class="fa fa-trash" title="<?=gettext("Delete rule")?>" href="firewall_nat.php?act=del&id=<?=$i?>" onclick="return confirm('<?=gettext("Are you sure you want to delete this rule?")?>')"></a> + <a class="fa fa-trash" title="<?=gettext("Delete rule")?>" href="firewall_nat.php?act=del&id=<?=$i?>"></a> </td> </tr> <?php |