diff options
Diffstat (limited to 'debian/tests/rlm_python3-data/ubuntu_example.py.mods-config')
-rw-r--r-- | debian/tests/rlm_python3-data/ubuntu_example.py.mods-config | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/debian/tests/rlm_python3-data/ubuntu_example.py.mods-config b/debian/tests/rlm_python3-data/ubuntu_example.py.mods-config index 5b6330f..7788559 100644 --- a/debian/tests/rlm_python3-data/ubuntu_example.py.mods-config +++ b/debian/tests/rlm_python3-data/ubuntu_example.py.mods-config @@ -2,6 +2,9 @@ import radiusd +def get_attribute(p, attribute): + return [x[1] for x in p if x[0] == attribute][0] + def instantiate(p): radiusd.radlog(radiusd.L_INFO, '*** example.py instantiate ***') return radiusd.RLM_MODULE_OK @@ -9,8 +12,8 @@ def instantiate(p): def authorize(p): radiusd.radlog(radiusd.L_INFO, '*** example.py authorize ***') # whatever password was supplied - config = ( ('Cleartext-Password', p[1][1]), ) - if p[0][1] == "ubuntu": + config = ( ('Cleartext-Password', get_attribute(p, 'User-Password')), ) + if get_attribute(p, 'User-Name') == "ubuntu": msg = "Hello ubuntu!" status = radiusd.RLM_MODULE_OK reply = ( ('Reply-Message', msg), ) |