From 6df157a1ffaebf6710e8e0f3efb067f7416b8e4d Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sat, 24 Oct 2015 11:37:17 +0000 Subject: [PATCH] (Captiveportal, new) add accounting cleanup to background process --- .../scripts/OPNsense/CaptivePortal/cp-background-process.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/opnsense/scripts/OPNsense/CaptivePortal/cp-background-process.py b/src/opnsense/scripts/OPNsense/CaptivePortal/cp-background-process.py index 4634c1f7f..816825d09 100755 --- a/src/opnsense/scripts/OPNsense/CaptivePortal/cp-background-process.py +++ b/src/opnsense/scripts/OPNsense/CaptivePortal/cp-background-process.py @@ -144,6 +144,11 @@ class CPBackgroundProcess(object): current_arp = self.arp.get_by_ipaddress(cpnet) if current_arp is not None and current_arp['mac'] != db_client['macAddress']: drop_session_reason = "mac address changed for session %s" % db_client['sessionId'] + + # session accounting + if db_client['acc_session_timeout'] is not None \ + and time.time() - float(db_client['startTime']) > db_client['acc_session_timeout'] : + drop_session_reason = "accounting limit reached for session %s" % db_client['sessionId'] elif db_client['authenticated_via'] == '---mac---': # detect mac changes current_ip = self.arp.get_address_by_mac(db_client['macAddress'])