summaryrefslogtreecommitdiffstats
path: root/usr/local/www/status_captiveportal_vouchers.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-02-12 09:07:34 -0200
committerRenato Botelho <garga@FreeBSD.org>2013-02-12 09:07:34 -0200
commit8184a8ddbb5c92cf3b01806c7a4f6172c95c7ed3 (patch)
tree43d376e0448560eae88e5d491c81ba8cc44b2898 /usr/local/www/status_captiveportal_vouchers.php
parentc2173267d96f8145506f9a2a318053412f1c9744 (diff)
downloadpfsense-8184a8ddbb5c92cf3b01806c7a4f6172c95c7ed3.zip
pfsense-8184a8ddbb5c92cf3b01806c7a4f6172c95c7ed3.tar.gz
Check if file exists before try to read it. Fixes #2764
Diffstat (limited to 'usr/local/www/status_captiveportal_vouchers.php')
-rw-r--r--usr/local/www/status_captiveportal_vouchers.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr/local/www/status_captiveportal_vouchers.php b/usr/local/www/status_captiveportal_vouchers.php
index 542dd1b..3bee04d 100644
--- a/usr/local/www/status_captiveportal_vouchers.php
+++ b/usr/local/www/status_captiveportal_vouchers.php
@@ -72,6 +72,10 @@ $db = array();
foreach($a_roll as $rollent) {
$roll = $rollent['number'];
$minutes = $rollent['minutes'];
+
+ if (!file_exists("{$g['vardb_path']}/voucher_{$cpzone}_active_$roll.db"))
+ continue;
+
$active_vouchers = file("{$g['vardb_path']}/voucher_{$cpzone}_active_$roll.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach($active_vouchers as $voucher => $line) {
list($voucher,$timestamp, $minutes) = explode(",", $line);
OpenPOWER on IntegriCloud