Development

This commit is contained in:
Matthew Grotke 2026-06-06 01:01:43 -04:00
parent 2c8153c004
commit 0f38304d60
5 changed files with 14 additions and 78 deletions

View file

@ -69,14 +69,17 @@ def auth_mode_save():
eap_protocol = request.form.get('eap_protocol', 'eap_peap')
if eap_protocol not in ('eap_peap', 'eap_ttls', 'eap_md5'):
eap_protocol = 'eap_peap'
tunneled_reply = 'tunneled_reply' in request.form
cfg = load_config()
before = copy.deepcopy(cfg.get('radius', {}).get('options', {}))
after = {**before, 'auth_mode': auth_mode}
if auth_mode == 'eap_password':
after['eap_protocol'] = eap_protocol
after['eap_protocol'] = eap_protocol
after['tunneled_reply'] = tunneled_reply and eap_protocol in ('eap_peap', 'eap_ttls')
else:
after.pop('eap_protocol', None)
after.pop('eap_protocol', None)
after.pop('tunneled_reply', None)
cfg.setdefault('radius', {})['options'] = after
changes = diff_fields(before, after)
@ -134,21 +137,6 @@ def default_vlan_save():
return redirect(f'/{_PAGE}')
@bp.route('/action/radius/eap_save', methods=['POST'])
@require_level('administrator')
def eap_save():
allow_weak_eap = 'allow_weak_eap' in request.form
tunneled_reply = 'tunneled_reply' in request.form
cfg = load_config()
before = copy.deepcopy(cfg.get('radius', {}).get('eap', {}))
after = {'allow_weak_eap': allow_weak_eap, 'tunneled_reply': tunneled_reply}
cfg.setdefault('radius', {})['eap'] = after
changes = diff_fields(before, after)
flash(record_group(cfg, 'radius.eap', 'setting', 'radius', changes, 'core apply'), 'success')
return redirect(f'/{_PAGE}')
@bp.route('/action/radius/logging_save', methods=['POST'])
@require_level('administrator')