Development
This commit is contained in:
parent
43c4cf380d
commit
f011594b04
10 changed files with 163 additions and 46 deletions
|
|
@ -62,13 +62,22 @@ def portal_save():
|
|||
except (ValueError, TypeError):
|
||||
duration = 0
|
||||
|
||||
try:
|
||||
exp_n = int(request.form.get('default_expiration_value', '0').strip() or '0')
|
||||
exp_unit = request.form.get('default_expiration_unit', 'hours')
|
||||
mult = {'hours': 3600, 'days': 86400}.get(exp_unit, 3600)
|
||||
expiration = exp_n * mult if exp_n > 0 else 0
|
||||
except (ValueError, TypeError):
|
||||
expiration = 0
|
||||
|
||||
after = {
|
||||
**existing,
|
||||
'portal_splash_title': splash_title,
|
||||
'portal_splash_text': splash_text,
|
||||
'portal_terms': terms,
|
||||
'require_username_password': require_upw,
|
||||
'default_session_seconds': duration,
|
||||
'portal_splash_title': splash_title,
|
||||
'portal_splash_text': splash_text,
|
||||
'portal_terms': terms,
|
||||
'require_username_password': require_upw,
|
||||
'default_session_seconds': duration,
|
||||
'default_expiration_seconds': expiration,
|
||||
}
|
||||
vlan['captive_portal'] = after
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue