Development
This commit is contained in:
parent
e52fe9bf8a
commit
db837af548
9 changed files with 98 additions and 25 deletions
|
|
@ -85,7 +85,7 @@ def auth_mode_save():
|
|||
if auth_mode == 'eap_password':
|
||||
after['eap_protocol'] = eap_protocol
|
||||
after['tunneled_reply'] = tunneled_reply and eap_protocol in ('eap_peap', 'eap_ttls')
|
||||
after['mab_first'] = mab_first
|
||||
after['mab_first'] = mab_first
|
||||
if eap_protocol in _valid_inner and inner_protocol in _valid_inner[eap_protocol]:
|
||||
after['inner_protocol'] = inner_protocol
|
||||
else:
|
||||
|
|
@ -94,18 +94,27 @@ def auth_mode_save():
|
|||
after['include_length'] = include_length
|
||||
else:
|
||||
after.pop('include_length', None)
|
||||
try:
|
||||
dur_n = int(request.form.get('default_session_value', '0').strip() or '0')
|
||||
dur_unit = request.form.get('default_session_unit', 'hours')
|
||||
mult = {'hours': 3600, 'days': 86400}.get(dur_unit, 3600)
|
||||
after['default_session_seconds'] = dur_n * mult if dur_n > 0 else 0
|
||||
except (ValueError, TypeError):
|
||||
after['default_session_seconds'] = 0
|
||||
elif auth_mode == 'eap_credential':
|
||||
after['include_length'] = include_length
|
||||
after['mab_first'] = mab_first
|
||||
after.pop('eap_protocol', None)
|
||||
after.pop('tunneled_reply', None)
|
||||
after.pop('inner_protocol', None)
|
||||
after['mab_first'] = mab_first
|
||||
after.pop('eap_protocol', None)
|
||||
after.pop('tunneled_reply', None)
|
||||
after.pop('inner_protocol', None)
|
||||
after.pop('default_session_seconds', None)
|
||||
else: # mab
|
||||
after.pop('eap_protocol', None)
|
||||
after.pop('tunneled_reply', None)
|
||||
after.pop('inner_protocol', None)
|
||||
after.pop('include_length', None)
|
||||
after.pop('mab_first', None)
|
||||
after.pop('eap_protocol', None)
|
||||
after.pop('tunneled_reply', None)
|
||||
after.pop('inner_protocol', None)
|
||||
after.pop('include_length', None)
|
||||
after.pop('mab_first', None)
|
||||
after.pop('default_session_seconds', None)
|
||||
cfg.setdefault('radius', {})['options'] = after
|
||||
|
||||
changes = config_utils.diff_fields(before, after)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue