ldap.LdapClient: make get_attr case-insensitive on attribute name
This commit is contained in:
parent
d1102ce1b3
commit
947ed765aa
1 changed files with 5 additions and 0 deletions
|
@ -448,6 +448,11 @@ class LdapClient:
|
||||||
returned instead of the first value only
|
returned instead of the first value only
|
||||||
(optinal, default: False)
|
(optinal, default: False)
|
||||||
"""
|
"""
|
||||||
|
if attr not in obj:
|
||||||
|
for k in obj:
|
||||||
|
if k.lower() == attr.lower():
|
||||||
|
attr = k
|
||||||
|
break
|
||||||
vals = obj.get(attr, [])
|
vals = obj.get(attr, [])
|
||||||
if vals:
|
if vals:
|
||||||
return vals if all_values else vals[0]
|
return vals if all_values else vals[0]
|
||||||
|
|
Loading…
Reference in a new issue