mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 03:13:12 +00:00
Fix radius proxy bug
This commit is contained in:
parent
aa0d9df5ac
commit
028a2cd28d
1 changed files with 12 additions and 0 deletions
|
@ -163,10 +163,22 @@ def post_auth(data):
|
||||||
nas_instance = find_nas_from_request(nas)
|
nas_instance = find_nas_from_request(nas)
|
||||||
# All non proxified requests
|
# All non proxified requests
|
||||||
if not nas_instance:
|
if not nas_instance:
|
||||||
|
user = data.get("User-Name", "")
|
||||||
|
user = user.split("@", 1)[0]
|
||||||
|
user = User.objects.filter(pseudo__iexact=username).first()
|
||||||
|
if not user or not user.has_access():
|
||||||
|
logger.info("Proxified request, user has no internet access: %s" % (username))
|
||||||
|
return radiusd.RLM_MODULE_REJECT
|
||||||
logger.info("Proxified request, nas unknown")
|
logger.info("Proxified request, nas unknown")
|
||||||
return radiusd.RLM_MODULE_OK
|
return radiusd.RLM_MODULE_OK
|
||||||
nas_type = Nas.objects.filter(nas_type=nas_instance.machine_type).first()
|
nas_type = Nas.objects.filter(nas_type=nas_instance.machine_type).first()
|
||||||
if not nas_type:
|
if not nas_type:
|
||||||
|
user = data.get("User-Name", "")
|
||||||
|
user = user.split("@", 1)[0]
|
||||||
|
user = User.objects.filter(pseudo__iexact=username).first()
|
||||||
|
if not user or not user.has_access():
|
||||||
|
logger.info("Proxified request, user has no internet access: %s" % (username))
|
||||||
|
return radiusd.RLM_MODULE_REJECT
|
||||||
logger.info("This kind of nas is not registered in the database!")
|
logger.info("This kind of nas is not registered in the database!")
|
||||||
return radiusd.RLM_MODULE_OK
|
return radiusd.RLM_MODULE_OK
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue