mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 03:13:12 +00:00
Merge branch '350-radius-fix' into 'dev'
Draft: Resolve "Radius script doesn't check cotisation/ban/whitelist when from a proxy" See merge request re2o/re2o!643
This commit is contained in:
commit
f80eae4d44
1 changed files with 12 additions and 0 deletions
|
@ -163,10 +163,22 @@ def post_auth(data):
|
|||
nas_instance = find_nas_from_request(nas)
|
||||
# All non proxified requests
|
||||
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")
|
||||
return radiusd.RLM_MODULE_OK
|
||||
nas_type = Nas.objects.filter(nas_type=nas_instance.machine_type).first()
|
||||
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!")
|
||||
return radiusd.RLM_MODULE_OK
|
||||
|
||||
|
|
Loading…
Reference in a new issue