summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-09-11 21:51:05 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-09-11 21:51:05 -0400
commitf986e40271db95c34307852ec8a9d96a094798fb (patch)
treed88de0c395817e2b29ba3978e4d690e23269aeeb /usr/local/www
parentd6f13f82899b4a58097599193b95559f1cd61d3a (diff)
downloadpfsense-f986e40271db95c34307852ec8a9d96a094798fb.zip
pfsense-f986e40271db95c34307852ec8a9d96a094798fb.tar.gz
Use already read in file to obtain the number of sessions
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/status_captiveportal.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr/local/www/status_captiveportal.php b/usr/local/www/status_captiveportal.php
index 358a04d..e1599f8 100755
--- a/usr/local/www/status_captiveportal.php
+++ b/usr/local/www/status_captiveportal.php
@@ -37,11 +37,14 @@ if ($_GET['act'] == "del") {
exit;
}
+// Lock and read in the captive portal DB
$captiveportallck = lock('captiveportal');
-$concurrent = `cat /var/db/captiveportal.db | wc -l`;
$cpcontents = file("/var/db/captiveportal.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
unlock($captiveportallck);
+// Set how many sessions are currently under flight
+$concurrent = count($cpcontents);
+
$pgtitle = "Status: Captive portal ({$concurrent})";
include("head.inc");
OpenPOWER on IntegriCloud