1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-25 18:54:29 +01:00

fix search template for AD backend

This commit is contained in:
kakwa 2015-07-26 10:23:43 +02:00
parent 2a4815e142
commit 23b3dbfbe3

View File

@ -92,11 +92,24 @@ class Backend(ldapcherry.backend.backendLdap.Backend):
self.builtin = 'CN=Builtin,' + basedn
self.user_filter_tmpl = '(sAMAccountName=%(username)s)'
self.group_filter_tmpl = '(uid=%(userdn)s)'
self.search_filter_tmpl = '(|(sAMAccountName=%(searchstring)s*)' \
'(sn=%(searchstring)s*)(cn=%(searchstring)s*))'
self.search_filter_tmpl = '(&(|(sAMAccountName=%(searchstring)s)' \
'(cn=%(searchstring)s*)' \
'(name=%(searchstring)s*)' \
'(givenName=%(searchstring)s*)' \
'(cn=%(searchstring)s*))' \
'(&(objectClass=person)' \
'(objectClass=user)' \
'(!(objectClass=computer)))' \
')'
self.dn_user_attr = 'cn'
self.key = 'sAMAccountName'
self.objectlasses = ['top', 'person', 'organizationalPerson', 'user']
self.objectlasses = [
'top',
'person',
'organizationalPerson',
'user',
'posixAccount',
]
self.group_attrs = {
'member': "%(dn)s"
}