diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-05-25 11:47:12 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-05-25 11:47:12 +0000 |
commit | 93ed765955f8891b985805e4d49ba96f8694c6d7 (patch) | |
tree | 42ff89930a11947a1e2b569b4293e6ba909d3426 | |
parent | 4b4271d32446788901a84a880f8ba14ac747801f (diff) | |
download | pfsense-93ed765955f8891b985805e4d49ba96f8694c6d7.zip pfsense-93ed765955f8891b985805e4d49ba96f8694c6d7.tar.gz |
Handle the case when no user has logged in. Reported by: http://forum.pfsense.org/index.php/topic,16382.0.html
-rwxr-xr-x | usr/local/www/status_captiveportal.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr/local/www/status_captiveportal.php b/usr/local/www/status_captiveportal.php index 056adc7..8895437 100755 --- a/usr/local/www/status_captiveportal.php +++ b/usr/local/www/status_captiveportal.php @@ -64,7 +64,10 @@ function clientcmp($a, $b) { } $cpdb = array(); -$cpcontents = file("/var/db/captiveportal.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); +if (file_exists("/var/db/captiveportal.db")) + $cpcontents = file("/var/db/captiveportal.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); +else + $cpcontents = array(); foreach ($cpcontents as $cpcontent) { $cpent = explode(",", $cpcontent); if ($_GET['showact']) |