summaryrefslogtreecommitdiffstats
path: root/etc/inc/captiveportal.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-07-09 23:41:29 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-07-09 23:41:29 +0000
commita40043993e8815238d440392029c2e22e4545c3e (patch)
tree9a388ea173d3ba9f0b07800731f5261c47ae5880 /etc/inc/captiveportal.inc
parentea44537a7805bb0a811be8bd357947613ff96790 (diff)
downloadpfsense-a40043993e8815238d440392029c2e22e4545c3e.zip
pfsense-a40043993e8815238d440392029c2e22e4545c3e.tar.gz
Correctly utilize expiretable
Diffstat (limited to 'etc/inc/captiveportal.inc')
-rw-r--r--etc/inc/captiveportal.inc10
1 files changed, 4 insertions, 6 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 5e45fbe..0d973f9 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -253,6 +253,8 @@ function captiveportal_prune_old() {
/* launch expiretable and remove entries older than $timeout */
mwexec("/usr/bin/nice -n20 /usr/local/sbin/expiretable -v -t " . ( $timeout * 60 ) . " captiveportal");
+ $after_prune = `/sbin/pfctl -A captiveportal -sr`;
+
/*
* loop back through and deterimine if expiretable removed a client.
* if we detect a client removale then update the internal db accordingly
@@ -264,10 +266,8 @@ function captiveportal_prune_old() {
/* hard timeout? */
if ((time() - $cpdb[$i][0]) >= $timeout)
$timedout = true;
-
-
- $new_list = `/sbin/pfctl -A captiveportal -sr`;
- if(stristr($current_list, $cpdb[$i][2]) == false)
+
+ if(stristr($after_prune, $cpdb[$i][2]) == false)
$timedout= true;
if ($timedout) {
@@ -284,8 +284,6 @@ function captiveportal_prune_old() {
syslog(LOG_INFO,"Authenticated user $cpdb[$i][4] timed out");
}
- mwexec("/usr/bin/nice -n20 /sbin/pfctl -t captiveportal -T delete {$cpdb[$i][2]}");
-
unset($cpdb[$i]);
}
}
OpenPOWER on IntegriCloud