diff options
author | bcyrill <cyrill@bannwart.info> | 2012-12-29 19:41:41 +0100 |
---|---|---|
committer | bcyrill <cyrill@bannwart.info> | 2012-12-29 19:41:41 +0100 |
commit | 5038fb5398bfac7d0a3fb17f258bbc6446eb9833 (patch) | |
tree | d525c10075f27b880c24d1cd3d7c236bb1dcc629 | |
parent | 0754d9b7248a0d1cf2cd932cf66a50c08f014f03 (diff) | |
download | pfsense-5038fb5398bfac7d0a3fb17f258bbc6446eb9833.zip pfsense-5038fb5398bfac7d0a3fb17f258bbc6446eb9833.tar.gz |
Fix: Disconnect CP client
-rw-r--r-- | etc/inc/captiveportal.inc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index a38435c..a06868b 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -873,17 +873,19 @@ function captiveportal_disconnect_client($sessionid, $term_cause = 1, $logoutRea $radiusservers = captiveportal_get_radius_servers(); /* read database */ - $cpentry = captiveportal_read_db("WHERE sessionid = '{$sessionid}'"); + $result = captiveportal_read_db("WHERE sessionid = '{$sessionid}'"); /* find entry */ - if (!empty($cpentry)) { + if (!empty($result)) { captiveportal_write_db("DELETE FROM captiveportal WHERE sessionid = '{$sessionid}'"); - if (empty($cpentry[10])) - $cpentry[10] = 'first'; - captiveportal_disconnect($cpentry, $radiusservers[$cpentry[10]], $term_cause); - captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "DISCONNECT"); - unset($cpentry); + foreach ($result as $cpentry) { + if (empty($cpentry[10])) + $cpentry[10] = 'first'; + captiveportal_disconnect($cpentry, $radiusservers[$cpentry[10]], $term_cause); + captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "DISCONNECT"); + } + unset($result); } } |