From 9f2bbdb44c5700384a37a9586d260492f14f7602 Mon Sep 17 00:00:00 2001 From: Steve Beaver Date: Tue, 14 Feb 2017 15:33:13 -0500 Subject: GET/POST conversion --- src/usr/local/www/services_captiveportal_mac.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/usr/local/www/services_captiveportal_mac.php') diff --git a/src/usr/local/www/services_captiveportal_mac.php b/src/usr/local/www/services_captiveportal_mac.php index e4aa160..45e9259 100644 --- a/src/usr/local/www/services_captiveportal_mac.php +++ b/src/usr/local/www/services_captiveportal_mac.php @@ -40,11 +40,7 @@ require_once("captiveportal.inc"); global $cpzone; global $cpzoneid; -$cpzone = $_GET['zone']; -if (isset($_POST['zone'])) { - $cpzone = $_POST['zone']; -} -$cpzone = strtolower(htmlspecialchars($cpzone)); +$cpzone = strtolower(htmlspecialchars($_REQUEST['zone'])); if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) { header("Location: services_captiveportal_zones.php"); @@ -54,6 +50,7 @@ if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) { if (!is_array($config['captiveportal'])) { $config['captiveportal'] = array(); } + $a_cp =& $config['captiveportal']; $pgtitle = array(gettext("Services"), gettext("Captive Portal"), $a_cp[$cpzone]['zone'], gettext("MACs")); @@ -63,7 +60,7 @@ $shortcut_section = "captiveportal"; $actsmbl = array('pass' => ' ' . gettext("Pass"), 'block' => ' ' . gettext("Block")); -if ($_POST) { +if ($_POST['save']) { $pconfig = $_POST; if ($_POST['apply']) { @@ -133,17 +130,17 @@ if ($_POST) { } } -if ($_GET['act'] == "del") { +if ($_POST['act'] == "del") { $a_passthrumacs =& $a_cp[$cpzone]['passthrumac']; - if ($a_passthrumacs[$_GET['id']]) { + if ($a_passthrumacs[$_POST['id']]) { $cpzoneid = $a_cp[$cpzone]['zoneid']; - $rules = captiveportal_passthrumac_delete_entry($a_passthrumacs[$_GET['id']]); + $rules = captiveportal_passthrumac_delete_entry($a_passthrumacs[$_POST['id']]); $uniqid = uniqid("{$cpzone}_mac"); file_put_contents("{$g['tmp_path']}/{$uniqid}_tmp", $rules); mwexec("/sbin/ipfw -q {$g['tmp_path']}/{$uniqid}_tmp"); @unlink("{$g['tmp_path']}/{$uniqid}_tmp"); - unset($a_passthrumacs[$_GET['id']]); + unset($a_passthrumacs[$_POST['id']]); write_config(); header("Location: services_captiveportal_mac.php?zone={$cpzone}"); exit; @@ -198,7 +195,7 @@ foreach ($a_cp[$cpzone]['passthrumac'] as $mac): ?> " href="services_captiveportal_mac_edit.php?zone=&id="> - " href="services_captiveportal_mac.php?zone=&act=del&id="> + " href="services_captiveportal_mac.php?zone=&act=del&id="usepost>