Development
This commit is contained in:
parent
ae0019f85d
commit
33ec9e7f1c
4 changed files with 36 additions and 16 deletions
|
|
@ -88,12 +88,20 @@ def auth_mode_save():
|
||||||
after['inner_protocol'] = inner_protocol
|
after['inner_protocol'] = inner_protocol
|
||||||
else:
|
else:
|
||||||
after.pop('inner_protocol', None)
|
after.pop('inner_protocol', None)
|
||||||
|
if eap_protocol in ('eap_peap', 'eap_ttls'):
|
||||||
|
after['include_length'] = include_length
|
||||||
|
else:
|
||||||
|
after.pop('include_length', None)
|
||||||
|
elif auth_mode == 'eap_credential':
|
||||||
after['include_length'] = include_length
|
after['include_length'] = include_length
|
||||||
else:
|
after.pop('eap_protocol', None)
|
||||||
after.pop('eap_protocol', None)
|
after.pop('tunneled_reply', None)
|
||||||
after.pop('tunneled_reply', None)
|
after.pop('inner_protocol', None)
|
||||||
after.pop('inner_protocol', None)
|
else: # mab
|
||||||
after.pop('include_length', None)
|
after.pop('eap_protocol', None)
|
||||||
|
after.pop('tunneled_reply', None)
|
||||||
|
after.pop('inner_protocol', None)
|
||||||
|
after.pop('include_length', None)
|
||||||
cfg.setdefault('radius', {})['options'] = after
|
cfg.setdefault('radius', {})['options'] = after
|
||||||
|
|
||||||
changes = diff_fields(before, after)
|
changes = diff_fields(before, after)
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"type": "p",
|
"type": "p",
|
||||||
"text": "Unknown or unregistered devices are assigned to this VLAN. For wired switch ports, also set the fallback network in your managed switch's configuration."
|
"text": "Unknown devices are assigned to this VLAN. For wired switch ports, also set the fallback network in your managed switch's configuration."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "raw_html",
|
"type": "raw_html",
|
||||||
|
|
@ -267,6 +267,18 @@
|
||||||
"value": "%RADIUS_TUNNELED_REPLY%",
|
"value": "%RADIUS_TUNNELED_REPLY%",
|
||||||
"hint": "Copies VLAN and authorization attributes from the inner EAP exchange to the outer RADIUS Access-Accept. Required by some switches for VLAN assignment to work correctly."
|
"hint": "Copies VLAN and authorization attributes from the inner EAP exchange to the outer RADIUS Access-Accept. Required by some switches for VLAN assignment to work correctly."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "raw_html",
|
||||||
|
"html": "</div>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "raw_html",
|
||||||
|
"html": "</div>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "raw_html",
|
||||||
|
"html": "<div id=\"eap-include-length-row\">"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "field",
|
"type": "field",
|
||||||
"label": "",
|
"label": "",
|
||||||
|
|
@ -280,10 +292,6 @@
|
||||||
"type": "raw_html",
|
"type": "raw_html",
|
||||||
"html": "</div>"
|
"html": "</div>"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "raw_html",
|
|
||||||
"html": "</div>"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "button_row",
|
"type": "button_row",
|
||||||
"items": [
|
"items": [
|
||||||
|
|
|
||||||
|
|
@ -104,9 +104,9 @@ def collect_tokens(cfg):
|
||||||
all_radius_clients = [r for r in cfg.get('dhcp_reservations', []) if r.get('radius_client') is True]
|
all_radius_clients = [r for r in cfg.get('dhcp_reservations', []) if r.get('radius_client') is True]
|
||||||
n = len(all_radius_clients)
|
n = len(all_radius_clients)
|
||||||
if n > 0:
|
if n > 0:
|
||||||
tokens['RADIUS_CLIENT_STATUS_TEXT'] = f"RADIUS will be disabled if there are no RADIUS Clients specified on the DHCP Reservations page. There are currently {n} RADIUS Client{'s' if n != 1 else ''}. RADIUS is enabled."
|
tokens['RADIUS_CLIENT_STATUS_TEXT'] = f"RADIUS will be disabled if there are no RADIUS Clients (authenticators) specified on the DHCP Reservations page. There are currently {n} RADIUS Client{'s' if n != 1 else ''}. RADIUS is enabled."
|
||||||
else:
|
else:
|
||||||
tokens['RADIUS_CLIENT_STATUS_TEXT'] = "RADIUS will be disabled if there are no RADIUS Clients specified on the DHCP Reservations page. There are currently 0 RADIUS Clients. RADIUS is disabled."
|
tokens['RADIUS_CLIENT_STATUS_TEXT'] = "RADIUS will be disabled if there are no RADIUS Clients (authenticators) specified on the DHCP Reservations page. There are currently 0 RADIUS Clients. RADIUS is disabled."
|
||||||
|
|
||||||
radius_client_reservations = [
|
radius_client_reservations = [
|
||||||
r for r in all_radius_clients
|
r for r in all_radius_clients
|
||||||
|
|
|
||||||
|
|
@ -295,10 +295,14 @@ def set_freeradius_eap(data):
|
||||||
inner_block = 'peap' if eap_protocol == 'eap_peap' else 'ttls'
|
inner_block = 'peap' if eap_protocol == 'eap_peap' else 'ttls'
|
||||||
content4 = _patch_setting_in_block(content4, inner_block, 'default_eap_type', inner_protocol)
|
content4 = _patch_setting_in_block(content4, inner_block, 'default_eap_type', inner_protocol)
|
||||||
|
|
||||||
if eap_protocol in ('eap_peap', 'eap_ttls'):
|
auth_mode = opts.get('auth_mode', 'mab')
|
||||||
il_val = 'yes' if opts.get('include_length', False) else 'no'
|
if auth_mode == 'eap_credential':
|
||||||
inner_blk = 'peap' if eap_protocol == 'eap_peap' else 'ttls'
|
il_val = 'yes' if opts.get('include_length', False) else 'no'
|
||||||
content4 = _patch_setting_in_block(content4, inner_blk, 'include_length', il_val)
|
content4 = _patch_setting_in_block(content4, 'tls', 'include_length', il_val)
|
||||||
|
elif eap_protocol in ('eap_peap', 'eap_ttls'):
|
||||||
|
il_val = 'yes' if opts.get('include_length', False) else 'no'
|
||||||
|
inner_blk = 'peap' if eap_protocol == 'eap_peap' else 'ttls'
|
||||||
|
content4 = _patch_setting_in_block(content4, inner_blk, 'include_length', il_val)
|
||||||
|
|
||||||
if content4 == content:
|
if content4 == content:
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue