Commit c4782349 authored by Franco Fichtner's avatar Franco Fichtner

captiveportal: cleanups loosely related to #114

parent d80be7bf
......@@ -679,12 +679,13 @@ function captiveportal_init_webgui_zone($cpcfg) {
* timestamp,ipfw_rule_no,clientip,clientmac,username,sessionid,password,session_timeout,idle_timeout,session_terminate_time,interim_interval
* (password is in Base64 and only saved when reauthentication is enabled)
*/
function captiveportal_prune_old() {
function captiveportal_prune_old()
{
global $g, $config, $cpzone, $cpzoneid;
if (empty($cpzone))
if (empty($cpzone)) {
return;
}
$cpc = new OPNsense\CaptivePortal\CPClient();
......@@ -853,20 +854,11 @@ function captiveportal_prune_old() {
}
}
}
}
unset($cpdb);
}
/* send RADIUS acct stop for all current clients */
function captiveportal_radius_stop_all() {
global $config, $cpzone;
......@@ -1637,4 +1629,3 @@ function captiveportal_send_server_accounting($off = false) {
$racct->close();
return $retvalue;
}
?>
......@@ -918,7 +918,7 @@ function system_generate_lighty_config(
@mkdir('/tmp/lighttpdcompress');
if ($captive_portal !== false) {
$captiveportal = ",\"mod_rewrite\",\"mod_evasive\"";
$captiveportal = ',"mod_evasive"';
$captive_portal_rewrite = "url.rewrite-once = ( \"(.*captiveportal.*)\" => \"$1\", \"(.*)\" => \"/index.php?zone={$captive_portal}&redirurl=$1\" )\n";
$maxprocperip = $config['captiveportal'][$captive_portal]['maxprocperip'];
......
......@@ -382,18 +382,8 @@ if ($_POST) {
$newcp['page']['logouttext'] = base64_encode(file_get_contents($_FILES['logoutfile']['tmp_name']));
write_config();
/* Clear up unselected interfaces */
$newifaces = explode(",", $newcp['interface']);
$toremove = array_diff($oldifaces, $newifaces);
if (!empty($toremove)) {
foreach ($toremove as $removeif) {
$removeif = get_real_interface($removeif);
mwexec("/sbin/ipfw zone {$cpzoneid} mdel {$removeif}");
}
}
captiveportal_configure_zone($newcp);
unset($newcp, $newifaces, $toremove);
unset($newcp);
filter_configure();
header("Location: services_captiveportal_zones.php");
exit;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment