KERNEL; USERS_LDAP: fix for compatibility with python2.3

bzr revid: ced-d1076edf24721bac637137c02eadfbe37f9961f8
This commit is contained in:
ced 2007-03-08 20:10:05 +00:00
parent cb3ecb3b1a
commit eddc2b7189
1 changed files with 4 additions and 4 deletions

View File

@ -62,7 +62,7 @@ def ldap_login(oldfnc):
for res_company in cr.dictfetchall():
try:
l = ldap.open(res_company['ldap_server'])
if l.simple_bind_s(res_company['ldap_binddn'], res_company['ldap_password']):
if l.simple_bind(res_company['ldap_binddn'], res_company['ldap_password']):
base = res_company['ldap_base']
scope = ldap.SCOPE_SUBTREE
filter = res_company['ldap_filter']%(login,)
@ -75,7 +75,7 @@ def ldap_login(oldfnc):
if result_type == ldap.RES_SEARCH_RESULT and len(result_data) == 1:
dn=result_data[0][0]
name=result_data[0][1]['cn']
if l.bind_s(dn, passwd):
if l.bind(dn, passwd):
cr.execute("select id from res_users where login=%s",(login.encode('utf-8'),))
res = cr.fetchone()
if res:
@ -112,7 +112,7 @@ def ldap_check(oldfnc):
company = user.company_id
try:
l = ldap.open(company.ldap_server)
if l.simple_bind_s(company.ldap_binddn, company.ldap_password):
if l.simple_bind(company.ldap_binddn, company.ldap_password):
base = company['ldap_base']
scope = ldap.SCOPE_SUBTREE
filter = company['ldap_filter']%(user.login,)
@ -123,7 +123,7 @@ def ldap_check(oldfnc):
if result_data and result_type == ldap.RES_SEARCH_RESULT and len(result_data) == 1:
dn=result_data[0][0]
name=result_data[0][1]['cn']
if l.bind_s(dn, passwd):
if l.bind(dn, passwd):
security._uid_cache[uid] = passwd
cr.close()
return True