mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 17:44:41 +00:00
(Captiveportal, new) add accounting cleanup to background process
This commit is contained in:
parent
e96e68f7c2
commit
6df157a1ff
@ -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'])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user