summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/system.inc
diff options
context:
space:
mode:
authorplumbeo <plumbeo@users.noreply.github.com>2016-12-29 18:43:13 +0100
committerRenato Botelho <renato@netgate.com>2017-01-04 14:37:13 -0200
commit414d27200c0f04c8382d1e7d9965a7ac63e62760 (patch)
treec01c793ecc7eba2511863c8ca4c5f98f53eace4d /src/etc/inc/system.inc
parent8ebf7ce7d988a989d040196769b0174278b0d031 (diff)
downloadpfsense-414d27200c0f04c8382d1e7d9965a7ac63e62760.zip
pfsense-414d27200c0f04c8382d1e7d9965a7ac63e62760.tar.gz
Captive portal: rework logging and RADIUS accounting when disabling a zone or rebooting
Make captiveportal_radius_stop_all() log the disconnections in the system log and fix it so that it works with the zone id parameter and sends complete RADIUS accounting packets. Since several zones can share the same RADIUS server, send an Accounting-Off packet only when rebooting, not when disabling a zone. (cherry picked from commit 3ece6d5404e0d4a53243d12e6b58793fad66dd5a)
Diffstat (limited to 'src/etc/inc/system.inc')
-rw-r--r--src/etc/inc/system.inc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc
index f905a72..93480e5 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -1954,13 +1954,16 @@ function system_reboot_sync() {
}
function system_reboot_cleanup() {
- global $config, $cpzone;
+ global $config, $cpzone, $cpzoneid;
mwexec("/usr/local/bin/beep.sh stop");
require_once("captiveportal.inc");
if (is_array($config['captiveportal'])) {
foreach ($config['captiveportal'] as $cpzone=>$cp) {
- captiveportal_radius_stop_all();
+ /* send Accounting-Stop packet for all clients, termination cause 'Admin-Reboot' */
+ $cpzoneid = $cp[zoneid];
+ captiveportal_radius_stop_all(7); // Admin-Reboot
+ /* Send Accounting-Off packet to the RADIUS server */
captiveportal_send_server_accounting(true);
}
}
OpenPOWER on IntegriCloud