From 287f7e26199a323f0f4cd08f9e0a94073b7d5112 Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 23 Jan 2013 16:24:17 +0000 Subject: Convert all captiveportal code to not use ipfw_set_context since its not needed anymore. Also add code to validate cpzone on webgui pages before being used --- usr/local/www/services_captiveportal_mac_edit.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'usr/local/www/services_captiveportal_mac_edit.php') diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php index b0e1ebb..d87408e 100755 --- a/usr/local/www/services_captiveportal_mac_edit.php +++ b/usr/local/www/services_captiveportal_mac_edit.php @@ -61,7 +61,7 @@ $cpzone = $_GET['zone']; if (isset($_POST['zone'])) $cpzone = $_POST['zone']; -if (empty($cpzone)) { +if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) { header("Location: services_captiveportal_zones.php"); exit; } @@ -158,8 +158,7 @@ if ($_POST) { $rules .= captiveportal_passthrumac_configure_entry($mac); $uniqid = uniqid("{$cpzone}_macedit"); file_put_contents("{$g['tmp_path']}/{$uniqid}_tmp", $rules); - captiveportal_ipfw_set_context($cpzone); - mwexec("/sbin/ipfw -q {$g['tmp_path']}/{$uniqid}_tmp"); + mwexec("/sbin/ipfw -x {$cpzone} -q {$g['tmp_path']}/{$uniqid}_tmp"); @unlink("{$g['tmp_path']}/{$uniqid}_tmp"); } -- cgit v1.1