diff options
Diffstat (limited to 'etc/inc/captiveportal.inc')
-rw-r--r-- | etc/inc/captiveportal.inc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 711b2d4..a87e732 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -652,6 +652,7 @@ function captiveportal_prune_old() { * had a chance to iterate over all accounts. */ $unsetindexes = array(); + $voucher_needs_sync = false; foreach ($cpdb as $cpentry) { $timedout = false; @@ -694,6 +695,7 @@ function captiveportal_prune_old() { if (time() >= ($cpentry[0] + $cpentry[7])) { $timedout = true; $term_cause = 5; // Session-Timeout + $voucher_needs_sync = true; } } @@ -762,6 +764,10 @@ function captiveportal_prune_old() { } } + if ($voucher_needs_sync == true) + /* Triger a sync of the vouchers on config */ + send_event("service sync vouchers"); + /* write database */ if (!empty($unsetindexes)) captiveportal_write_db($cpdb, false, $unsetindexes); |