Development

This commit is contained in:
Matthew Grotke 2026-06-08 01:08:24 -04:00
parent 43c4cf380d
commit f011594b04
10 changed files with 163 additions and 46 deletions

View file

@ -101,20 +101,29 @@ def auth_mode_save():
after['default_session_seconds'] = dur_n * mult if dur_n > 0 else 0
except (ValueError, TypeError):
after['default_session_seconds'] = 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)
after['default_expiration_seconds'] = exp_n * mult if exp_n > 0 else 0
except (ValueError, TypeError):
after['default_expiration_seconds'] = 0
elif auth_mode == 'eap_certificate':
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.pop('default_session_seconds', None)
after.pop('eap_protocol', None)
after.pop('tunneled_reply', None)
after.pop('inner_protocol', None)
after.pop('default_session_seconds', None)
after.pop('default_expiration_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('default_session_seconds', 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)
after.pop('default_expiration_seconds', None)
cfg.setdefault('radius', {})['options'] = after
changes = config_utils.diff_fields(before, after)