Made LDAP search case insensitive

This commit is contained in:
Daniel Dayley 2020-08-18 09:44:17 -06:00
parent a04e4258ea
commit ebfc297a3e

View File

@ -33,7 +33,7 @@ class ServiceDelegate(ServiceBase) :
scope = 'BASE'
if self._config['scope'].upper() in ['ONE','LEVEL'] :
scope = 'LEVEL'
self.connection.search(self._config['search_base'], '(' + self._config['filter_string'] + subject + ')', search_scope=scope,attributes=ldap3.ALL_ATTRIBUTES)
self.connection.search(self._config['search_base'], '(' + self._config['filter_string'] + subject.lower() + ')', search_scope=scope,attributes=ldap3.ALL_ATTRIBUTES)
except Exception as exception :
self.error.append('Problem with LDAP search: ' + exception)
return