diff options
author | Ermal <eri@pfsense.org> | 2013-11-21 21:18:00 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-11-21 21:18:00 +0000 |
commit | baec2b007fa963f9c047ef08b16abc92c571c407 (patch) | |
tree | 94d4ecc36df550dbcbade2518b33fc5211a3f3f8 /usr/local/www/services_captiveportal_mac.php | |
parent | fc5a4f3c22bc0cfc44a8d0e74a1a5fda12ba9f8b (diff) | |
download | pfsense-baec2b007fa963f9c047ef08b16abc92c571c407.zip pfsense-baec2b007fa963f9c047ef08b16abc92c571c407.tar.gz |
Properly create zones for the CP with the new command arguments and properly invoke ipfw for applying rules and other configuration options.
Diffstat (limited to 'usr/local/www/services_captiveportal_mac.php')
-rwxr-xr-x | usr/local/www/services_captiveportal_mac.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php index b0a8492..e636f7b 100755 --- a/usr/local/www/services_captiveportal_mac.php +++ b/usr/local/www/services_captiveportal_mac.php @@ -44,6 +44,9 @@ require_once("filter.inc"); require("shaper.inc"); require("captiveportal.inc"); +global $cpzone; +global $cpzoneid; + $cpzone = $_GET['zone']; if (isset($_POST['zone'])) $cpzone = $_POST['zone']; @@ -102,10 +105,11 @@ if ($_POST) { } } if ($found == true) { + $cpzoneid = $a_cp[$cpzone]['zoneid']; $rules = captiveportal_passthrumac_delete_entry($a_passthrumacs[$idx]); $uniqid = uniqid("{$cpzone}_mac"); file_put_contents("{$g['tmp_path']}/{$uniqid}_tmp", $rules); - mwexec("/sbin/ipfw -x {$cpzone} -q {$g['tmp_path']}/{$uniqid}_tmp"); + mwexec("/sbin/ipfw -x {$cpzoneid} -q {$g['tmp_path']}/{$uniqid}_tmp"); @unlink("{$g['tmp_path']}/{$uniqid}_tmp"); unset($a_passthrumacs[$idx]); write_config(); @@ -120,10 +124,11 @@ if ($_POST) { if ($_GET['act'] == "del") { $a_passthrumacs =& $a_cp[$cpzone]['passthrumac']; if ($a_passthrumacs[$_GET['id']]) { + $cpzoneid = $a_cp[$cpzone]['zoneid']; $rules = captiveportal_passthrumac_delete_entry($a_passthrumacs[$_GET['id']]); $uniqid = uniqid("{$cpzone}_mac"); file_put_contents("{$g['tmp_path']}/{$uniqid}_tmp", $rules); - mwexec("/sbin/ipfw -x {$cpzone} -q {$g['tmp_path']}/{$uniqid}_tmp"); + mwexec("/sbin/ipfw -x {$cpzoneid} -q {$g['tmp_path']}/{$uniqid}_tmp"); @unlink("{$g['tmp_path']}/{$uniqid}_tmp"); unset($a_passthrumacs[$_GET['id']]); write_config(); |