[FIX] auth_ldap: allow non-ascii ldap base

For installations with accents in the name

Closes #15597
This commit is contained in:
Stéphane Bidoul (ACSONE)
2017-02-24 15:18:51 +01:00
committed by Martin Trigaux
parent 685f146d48
commit 6f1c291982
+1 -1
View File
@@ -145,7 +145,7 @@ class CompanyLDAP(models.Model):
ldap_password = conf['ldap_password'] or ''
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)
results = conn.search_st(conf['ldap_base'].encode('utf-8'), ldap.SCOPE_SUBTREE, filter, retrieve_attributes, timeout=60)
conn.unbind()
except ldap.INVALID_CREDENTIALS:
_logger.error('LDAP bind failed.')