# HG changeset patch # User Marcin Kuzminski # Date 1343920195 -7200 # Node ID 8e10ce55531d0440333ac94f047e246dbf347371 # Parent 3b179f1ac3a29aef822753e98616f2ff3efa729a ldap requires only string attributes, fixes #435 ldap-does-not-work-with-non-latin-symbols diff -r 3b179f1ac3a2 -r 8e10ce55531d rhodecode/lib/auth_ldap.py --- a/rhodecode/lib/auth_ldap.py Thu Aug 02 20:12:16 2012 +0200 +++ b/rhodecode/lib/auth_ldap.py Thu Aug 02 17:09:55 2012 +0200 @@ -27,6 +27,7 @@ from rhodecode.lib.exceptions import LdapConnectionError, LdapUsernameError, \ LdapPasswordError +from rhodecode.lib.utils2 import safe_str log = logging.getLogger(__name__) @@ -60,15 +61,15 @@ self.LDAP_SERVER_PORT = port # USE FOR READ ONLY BIND TO LDAP SERVER - self.LDAP_BIND_DN = bind_dn - self.LDAP_BIND_PASS = bind_pass + self.LDAP_BIND_DN = safe_str(bind_dn) + self.LDAP_BIND_PASS = safe_str(bind_pass) self.LDAP_SERVER = "%s://%s:%s" % (ldap_server_type, self.LDAP_SERVER_ADDRESS, self.LDAP_SERVER_PORT) - self.BASE_DN = base_dn - self.LDAP_FILTER = ldap_filter + self.BASE_DN = safe_str(base_dn) + self.LDAP_FILTER = safe_str(ldap_filter) self.SEARCH_SCOPE = getattr(ldap, 'SCOPE_%s' % search_scope) self.attr_login = attr_login