[FIX] auth_ldap: Bind DB encoding

In case of unicode
Closes #6926
This commit is contained in:
Marcio Mazza 2015-07-13 15:25:15 +02:00 committed by Martin Trigaux
parent 4d8986207f
commit ecc39a95c1
1 changed files with 2 additions and 1 deletions

View File

@ -141,7 +141,8 @@ class CompanyLDAP(osv.osv):
try:
conn = self.connect(conf)
ldap_password = conf['ldap_password'] or ''
conn.simple_bind_s(conf['ldap_binddn'] or '', ldap_password.encode('utf-8'))
ldap_binddn = conf['ldap_binddn'] or ''
conn.simple_bind_s(ldap_binddn.encode('utf-8'), ldap_password.encode('utf-8'))
results = conn.search_st(conf['ldap_base'], ldap.SCOPE_SUBTREE,
filter, retrieve_attributes, timeout=60)
conn.unbind()