Commit 45dba8bc authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root

On fait appel au stripped user name de préférence

parent ff354f1c
......@@ -450,7 +450,7 @@ class RadiusEventHandler(object):
"""Récupère les informations de la machine concernée en vue de
préparer la phase d'authentification"""
m_type = type_of_machine(request)
username = request.get('User-Name', None)
username = request.get('Stripped-User-Name', request.get('User-Name', None))
mac = request.get('Calling-Station-Id', None)
if m_type not in [TYPE_WIRED, TYPE_WIRELESS]:
logger.error('[pre-auth] Invalid machine type %s.', m_type)
......@@ -658,7 +658,7 @@ class RadiusEventHandler(object):
nas_id = request.get('NAS-IP-Address', request.get('NAS-IPv6-Address', 'Unknown'))
owner, machine, hosts, plug, room = self.find_match(request, m_type)
if room and plug:
mac = request.get('Calling-Station-Id', request.get('User-Name', None))
mac = request.get('Calling-Station-Id', request.get('Stripped-User-Name', request.get('User-Name', None)))
logger.info("[post-auth] Mac-address %s auth on room %s/%s" % (mac, room, plug))
room = ldap_unpack(hosts[0]['chbre']) if hosts else None
if machine is None:
......@@ -951,7 +951,7 @@ class RadiusEventHandler(object):
des données fournies.
Peut renvoyer None pour n'importe laquelle des deux composantes"""
mac = request.get('Calling-Station-Id', None)
username = request.get('User-Name', None)
username = request.get('Stripped-User-Name', request.get('User-Name', None))
nas_id = request.get('NAS-Identifier', None)
port = request.get('NAS-Port', None)
params = {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment