Development

This commit is contained in:
Matthew Grotke 2026-06-08 01:19:29 -04:00
parent f011594b04
commit b4e773c7b2
5 changed files with 32 additions and 7 deletions

View file

@ -202,7 +202,7 @@
"input_type": "number",
"min": 0,
"value": "0",
"hint": "How long after creation an account is valid before it permanently expires. 0 = never expires."
"hint": "How long before account permanently expires. 0 = never expires."
},
{
"type": "field",

View file

@ -201,7 +201,7 @@
"input_type": "number",
"min": 0,
"value": "0",
"hint": "How long after creation an account is valid before it permanently expires. 0 = never expires."
"hint": "How long before account permanently expires. 0 = never expires."
},
{
"type": "field",

View file

@ -251,7 +251,7 @@
"input_type": "number",
"min": 0,
"value": "%RADIUS_DEFAULT_EXPIRATION_VALUE%",
"hint": "How long after creation an account is valid before it permanently expires. 0 = never expires."
"hint": "How long before account permanently expires. 0 = never expires."
},
{
"type": "field",

View file

@ -80,7 +80,10 @@ def _verify_credential(username, password, vlan_name):
return False
if row is None:
return False
if row['session_seconds'] > 0 and (row['date_set'] + row['session_seconds']) < int(time.time()):
now = int(time.time())
if row['session_seconds'] > 0 and (row['date_set'] + row['session_seconds']) < now:
return False
if row['expires_seconds'] > 0 and (row['date_set'] + row['expires_seconds']) < now:
return False
if row['digest_type'] == DIGEST_HASH_BCRYPT:
try: