From 41ee55145341f5aa4be1ca16878285c551fa3d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20LU=C3=87I?= Date: Thu, 16 Apr 2015 20:17:05 +0200 Subject: [PATCH] Fixes #4625 correct disconnection of users especially when called from xmlrpc code. --- etc/inc/voucher.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc index f6b7248a20..afb31cd61e 100644 --- a/etc/inc/voucher.inc +++ b/etc/inc/voucher.inc @@ -217,7 +217,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'])) { @@ -279,6 +279,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];