From d0cd8dada11858325b9098cc7f40d38d3366170e Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Wed, 11 Apr 2007 07:37:51 +0000 Subject: [PATCH] USERS_LDAP: use synchro connection to bind bzr revid: mga@tinyerp.com-35153e550eab34cc99962f2ec9d0445ddcfbe066 --- addons/users_ldap/users_ldap.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/users_ldap/users_ldap.py b/addons/users_ldap/users_ldap.py index 8126c3bd3e4..ca1e428579f 100644 --- a/addons/users_ldap/users_ldap.py +++ b/addons/users_ldap/users_ldap.py @@ -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(res_company['ldap_binddn'], res_company['ldap_password']): + if l.simple_bind_s(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'][0] - if l.bind(dn, passwd): + if l.bind_s(dn, passwd): l.unbind() cr.execute("select id from res_users where login=%s",(login.encode('utf-8'),)) res = cr.fetchone() @@ -114,7 +114,7 @@ def ldap_check(oldfnc): company = user.company_id try: l = ldap.open(company.ldap_server) - if l.simple_bind(company.ldap_binddn, company.ldap_password): + if l.simple_bind_s(company.ldap_binddn, company.ldap_password): base = company['ldap_base'] scope = ldap.SCOPE_SUBTREE filter = company['ldap_filter']%(user.login,) @@ -125,7 +125,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(dn, passwd): + if l.bind_s(dn, passwd): l.unbind() security._uid_cache[uid] = passwd cr.close()