diff options
author | Steve Beaver <sbeaver@netgate.com> | 2017-02-10 14:33:33 -0500 |
---|---|---|
committer | Steve Beaver <sbeaver@netgate.com> | 2017-02-10 14:33:33 -0500 |
commit | 01b30fa7eeda901f2856b02fd3614513c421b68b (patch) | |
tree | 4df5dd2b90220c9a8a0a7c767369615652a498f6 /src/usr/local/www/firewall_nat_npt.php | |
parent | b92055596a099ebd9bea37039118c1c431cd0797 (diff) | |
download | pfsense-01b30fa7eeda901f2856b02fd3614513c421b68b.zip pfsense-01b30fa7eeda901f2856b02fd3614513c421b68b.tar.gz |
GET/POST conversion firewall_nat_npt*
Diffstat (limited to 'src/usr/local/www/firewall_nat_npt.php')
-rw-r--r-- | src/usr/local/www/firewall_nat_npt.php | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/src/usr/local/www/firewall_nat_npt.php b/src/usr/local/www/firewall_nat_npt.php index ff438ee..f836095 100644 --- a/src/usr/local/www/firewall_nat_npt.php +++ b/src/usr/local/www/firewall_nat_npt.php @@ -63,23 +63,21 @@ if (array_key_exists('order-store', $_POST)) { } } -if ($_POST) { - $pconfig = $_POST; +$pconfig = $_POST; - if ($_POST['apply']) { - $retval = 0; - $retval |= filter_configure(); +if ($_POST['apply']) { + $retval = 0; + $retval |= filter_configure(); - if ($retval == 0) { - clear_subsystem_dirty('natconf'); - clear_subsystem_dirty('filter'); - } + if ($retval == 0) { + clear_subsystem_dirty('natconf'); + clear_subsystem_dirty('filter'); } } -if ($_GET['act'] == "del") { - if ($a_npt[$_GET['id']]) { - unset($a_npt[$_GET['id']]); +if ($_POST['act'] == "del") { + if ($a_npt[$_POST['id']]) { + unset($a_npt[$_POST['id']]); if (write_config()) { mark_subsystem_dirty('natconf'); } @@ -103,12 +101,12 @@ if (isset($_POST['del_x'])) { exit; } -} else if ($_GET['act'] == "toggle") { - if ($a_npt[$_GET['id']]) { - if (isset($a_npt[$_GET['id']]['disabled'])) { - unset($a_npt[$_GET['id']]['disabled']); +} else if ($_POST['act'] == "toggle") { + if ($a_npt[$_POST['id']]) { + if (isset($a_npt[$_POST['id']]['disabled'])) { + unset($a_npt[$_POST['id']]['disabled']); } else { - $a_npt[$_GET['id']]['disabled'] = true; + $a_npt[$_POST['id']]['disabled'] = true; } if (write_config(gettext("Firewall: NAT: NPt, enable/disable NAT rule"))) { mark_subsystem_dirty('natconf'); @@ -175,7 +173,7 @@ display_top_tabs($tab_array); <input type="checkbox" id="frc<?=$i;?>" onClick="fr_toggle(<?=$i;?>)" name="rule[]" value="<?=$i;?>"/> </td> <td> - <a href="?act=toggle&id=<?=$i?>"> + <a href="?act=toggle&id=<?=$i?>" usepost> <i class="fa <?= ($iconfn == "pass") ? "fa-check":"fa-times"?>" title="<?=gettext("click to toggle enabled/disabled status")?>"></i> </a> </td> @@ -206,9 +204,9 @@ display_top_tabs($tab_array); ?> </td> <td> - <a class="fa fa-pencil" title="<?=gettext("Edit mapping")?>" href="firewall_nat_npt_edit.php?id=<?=$i?>"></a> - <a class="fa fa-clone" title="<?=gettext("Add a new mapping based on this one")?>" href="firewall_nat_npt_edit.php?dup=<?=$i?>"></a> - <a class="fa fa-trash" title="<?=gettext("Delete mapping")?>" href="firewall_nat_npt.php?act=del&id=<?=$i?>"></a> + <a class="fa fa-pencil" title="<?=gettext("Edit mapping")?>" href="firewall_nat_npt_edit.php?id=<?=$i?>" usepost></a> + <a class="fa fa-clone" title="<?=gettext("Add a new mapping based on this one")?>" href="firewall_nat_npt_edit.php?dup=<?=$i?>" usepost></a> + <a class="fa fa-trash" title="<?=gettext("Delete mapping")?>" href="firewall_nat_npt.php?act=del&id=<?=$i?>" usepost></a> </td> </tr> <?php @@ -221,11 +219,11 @@ endforeach; </div> <nav class="action-buttons"> - <a href="firewall_nat_npt_edit.php?after=-1" class="btn btn-sm btn-success" title="<?=gettext('Add mapping to the top of the list')?>"> + <a href="firewall_nat_npt_edit.php?after=-1" class="btn btn-sm btn-success" title="<?=gettext('Add mapping to the top of the list')?>" usepost> <i class="fa fa-level-up icon-embed-btn"></i> <?=gettext('Add')?> </a> - <a href="firewall_nat_npt_edit.php" class="btn btn-sm btn-success" title="<?=gettext('Add mapping to the end of the list')?>"> + <a href="firewall_nat_npt_edit.php" class="btn btn-sm btn-success" title="<?=gettext('Add mapping to the end of the list')?>" usepost> <i class="fa fa-level-down icon-embed-btn"></i> <?=gettext('Add')?> </a> |