+

get_attr : make case-insensitive on attribute name

Benjamin Renard [2018-02-13 10:59:01]
get_attr : make case-insensitive on attribute name
Filename
LdapServer.py
diff --git a/LdapServer.py b/LdapServer.py
index 6f6b6f4..93102ae 100644
--- a/LdapServer.py
+++ b/LdapServer.py
@@ -106,6 +106,11 @@ class LdapServer(object):
 		return obj[0][0]

 	def get_attr(self,obj,attr,all=None,default=None):
+		if attr not in obj:
+			for k in obj:
+				if k.lower() == attr.lower():
+					attr = k
+					break
 		if all is not None:
 			if attr in obj:
 				return obj[attr]
ViewGit