summaryrefslogtreecommitdiffstats
path: root/etc/inc/voucher.inc
diff options
context:
space:
mode:
authorErmal LUÇI <eri@pfsense.org>2015-04-16 20:17:05 +0200
committerErmal LUÇI <eri@pfsense.org>2015-04-16 20:17:05 +0200
commitabaa7feb680dc6f6f9bc79577075c45b3786a061 (patch)
tree7518cea95faf60e4c9137c22a8ce26a6bde782e6 /etc/inc/voucher.inc
parent2bc08de4e8654ce35d57a91073a99feb5ceb2d19 (diff)
downloadpfsense-abaa7feb680dc6f6f9bc79577075c45b3786a061.zip
pfsense-abaa7feb680dc6f6f9bc79577075c45b3786a061.tar.gz
Fixes #4625 correct disconnection of users especially when called from xmlrpc code.
Diffstat (limited to 'etc/inc/voucher.inc')
-rw-r--r--etc/inc/voucher.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc
index 25c12ee..932a515 100644
--- a/etc/inc/voucher.inc
+++ b/etc/inc/voucher.inc
@@ -226,7 +226,7 @@ EOF;
}
function voucher_expire($voucher_received) {
- global $g, $config, $cpzone;
+ global $g, $config, $cpzone, $cpzoneid;
// XMLRPC Call over to the master Voucher node
if (!empty($config['voucher'][$cpzone]['vouchersyncdbip'])) {
@@ -292,6 +292,8 @@ function voucher_expire($voucher_received) {
/* Check if this voucher has any active sessions */
$cpentry = captiveportal_read_db("WHERE username = '{$voucher}'");
if (!empty($cpentry)) {
+ if (empty($cpzoneid) && !empty($config['captiveportal'][$cpzone]))
+ $cpzoneid = $config['captiveportal'][$cpzone]['zoneid'];
captiveportal_disconnect($cpentry,null,13);
captiveportal_logportalauth($cpentry[4],$cpentry[3],$cpentry[2],"FORCLY TERMINATING VOUCHER {$voucher} SESSION");
$unsetindexes[] = $cpentry[5];
OpenPOWER on IntegriCloud