autocapture en wifi uniquement

This commit is contained in:
chapeau 2021-10-23 12:03:06 +02:00
parent d1ac9ec8eb
commit f902031871

17
auth.py
View file

@ -208,15 +208,6 @@ def post_auth(data):
user = data_from_api2["user"] user = data_from_api2["user"]
user_interface = data_from_api2["user_interface"] user_interface = data_from_api2["user_interface"]
result, log = check_user_machine_and_register(
nas_type, user, user_interface, nas, username, mac)
logger.info(log.encode("utf-8"))
logger.info(username.encode("utf-8"))
if not result:
return radiusd.RLM_MODULE_REJECT
# If proxified request # If proxified request
if not nas_type: if not nas_type:
logger.info("Proxified request, nas unknown") logger.info("Proxified request, nas unknown")
@ -263,6 +254,14 @@ def post_auth(data):
# Else it is from wifi # Else it is from wifi
else: else:
result, log = check_user_machine_and_register(
nas_type, user, user_interface, nas, username, mac)
logger.info(log.encode("utf-8"))
logger.info(username.encode("utf-8"))
if not result:
return radiusd.RLM_MODULE_REJECT
return radiusd.RLM_MODULE_OK return radiusd.RLM_MODULE_OK