[lc_ldap] bugfixes
This commit is contained in:
parent
6c35fc87b6
commit
b968849d51
1 changed files with 2 additions and 2 deletions
|
@ -92,7 +92,7 @@ class lc_ldap(ldap.ldapobject.LDAPObject):
|
||||||
|
|
||||||
if user and not dn:
|
if user and not dn:
|
||||||
self.simple_bind_s(base_dn)
|
self.simple_bind_s(base_dn)
|
||||||
res = self.search_s('uid=%s' % user)
|
res = self.search_s(base_dn, 1, 'uid=%s' % user)
|
||||||
if len(res) < 1:
|
if len(res) < 1:
|
||||||
raise ldap.INVALID_CREDENTIALS({'desc': 'No such user: %s' % user })
|
raise ldap.INVALID_CREDENTIALS({'desc': 'No such user: %s' % user })
|
||||||
elif len(res) > 1:
|
elif len(res) > 1:
|
||||||
|
@ -108,7 +108,7 @@ class lc_ldap(ldap.ldapobject.LDAPObject):
|
||||||
self.dn = None
|
self.dn = None
|
||||||
self.droits = []
|
self.droits = []
|
||||||
|
|
||||||
def search(self, filterstr, mode='ro', dn= base_dn, scope= 2, sizelimit=400):
|
def search(self, filterstr='(objectClass=*)', mode='ro', dn= base_dn, scope= 2, sizelimit=400):
|
||||||
res = self.search_ext_s(dn, scope, filterstr, sizelimit=sizelimit)
|
res = self.search_ext_s(dn, scope, filterstr, sizelimit=sizelimit)
|
||||||
return [ new_cransldapobject(self, r[0], mode=mode) for r in res ]
|
return [ new_cransldapobject(self, r[0], mode=mode) for r in res ]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue