summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets/widgets/captive_portal_status.widget.php
diff options
context:
space:
mode:
authorDarren Embry <dse@webonastick.com>2012-10-26 17:09:41 -0400
committerDarren Embry <dse@webonastick.com>2012-10-26 17:09:41 -0400
commit61cf2b7ed7cfbbab57ec049032d6b953b921904d (patch)
tree7757799232106fe10bbddf64333d0094bed76139 /usr/local/www/widgets/widgets/captive_portal_status.widget.php
parent219d9eb9a987387beff52a3852734e049aae1882 (diff)
downloadpfsense-61cf2b7ed7cfbbab57ec049032d6b953b921904d.zip
pfsense-61cf2b7ed7cfbbab57ec049032d6b953b921904d.tar.gz
now works again
most likely fixes #2638
Diffstat (limited to 'usr/local/www/widgets/widgets/captive_portal_status.widget.php')
-rw-r--r--usr/local/www/widgets/widgets/captive_portal_status.widget.php31
1 files changed, 17 insertions, 14 deletions
diff --git a/usr/local/www/widgets/widgets/captive_portal_status.widget.php b/usr/local/www/widgets/widgets/captive_portal_status.widget.php
index b9d7933..67e5f20 100644
--- a/usr/local/www/widgets/widgets/captive_portal_status.widget.php
+++ b/usr/local/www/widgets/widgets/captive_portal_status.widget.php
@@ -55,22 +55,25 @@ function clientcmp($a, $b) {
return strcmp($a[$order], $b[$order]);
}
-$cpdb = array();
-if (file_exists("{$g['vardb_path']}/captiveportal.db")) {
- $captiveportallck = lock('captiveportaldb');
- $cpcontents = file("{$g['vardb_path']}/captiveportal.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
- unlock($captiveportallck);
-} else
- $cpcontents = array();
+if (!is_array($config['captiveportal']))
+ $config['captiveportal'] = array();
+$a_cp =& $config['captiveportal'];
-$concurrent = count($cpcontents);
+$cpdb = array();
-foreach ($cpcontents as $cpcontent) {
- $cpent = explode(",", $cpcontent);
- $sessionid = $cpent[5];
- if ($_GET['showact'])
- $cpent[5] = captiveportal_get_last_activity($cpent[2]);
- $cpdb[$sessionid] = $cpent;
+foreach ($a_cp as $cpzone => $cp) {
+ if (file_exists("{$g['vardb_path']}/captiveportal_{$cpzone}.db")) {
+ $captiveportallck = lock('captiveportaldb');
+ $cpcontents = file("{$g['vardb_path']}/captiveportal_{$cpzone}.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
+ unlock($captiveportallck);
+ foreach ($cpcontents as $cpcontent) {
+ $cpent = explode(",", $cpcontent);
+ $sessionid = $cpent[5];
+ if ($_GET['showact'])
+ $cpent[5] = captiveportal_get_last_activity($cpent[2]);
+ $cpdb[$sessionid] = $cpent;
+ }
+ }
}
if ($_GET['order']) {
OpenPOWER on IntegriCloud