From d07370763a637ad093a03b90736273a4d93e67bc Mon Sep 17 00:00:00 2001 From: Steve Beaver Date: Fri, 10 Feb 2017 14:21:00 -0500 Subject: GET/POST conversion --- src/usr/local/www/firewall_nat_1to1.php | 42 +++++++++++++--------------- src/usr/local/www/firewall_nat_1to1_edit.php | 6 +--- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/usr/local/www/firewall_nat_1to1.php b/src/usr/local/www/firewall_nat_1to1.php index 236dd6f..0f19e7f 100644 --- a/src/usr/local/www/firewall_nat_1to1.php +++ b/src/usr/local/www/firewall_nat_1to1.php @@ -62,23 +62,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_1to1[$_GET['id']]) { - unset($a_1to1[$_GET['id']]); +if ($_POST['act'] == "del") { + if ($a_1to1[$_POST['id']]) { + unset($a_1to1[$_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_1to1[$_GET['id']]) { - if (isset($a_1to1[$_GET['id']]['disabled'])) { - unset($a_1to1[$_GET['id']]['disabled']); +} else if ($_POST['act'] == "toggle") { + if ($a_1to1[$_POST['id']]) { + if (isset($a_1to1[$_POST['id']]['disabled'])) { + unset($a_1to1[$_POST['id']]['disabled']); } else { - $a_1to1[$_GET['id']]['disabled'] = true; + $a_1to1[$_POST['id']]['disabled'] = true; } if (write_config(gettext("Firewall: NAT: 1:1, enable/disable NAT rule"))) { mark_subsystem_dirty('natconf'); @@ -216,9 +214,9 @@ display_top_tabs($tab_array); - " href="firewall_nat_1to1_edit.php?id="> - " href="firewall_nat_1to1_edit.php?dup="> - " href="firewall_nat_1to1.php?act=del&id="> + " href="firewall_nat_1to1_edit.php?id=" usepost> + " href="firewall_nat_1to1_edit.php?dup=" usepost> + " href="firewall_nat_1to1.php?act=del&id=" usepost> @@ -232,11 +230,11 @@ display_top_tabs($tab_array);