##// END OF EJS Templates
pep8
marcink -
r1170:6a9a5af4 beta
parent child Browse files
Show More
@@ -99,8 +99,10 b' class AuthLdap(object):'
99 server.simple_bind_s(self.LDAP_BIND_DN, self.LDAP_BIND_PASS)
99 server.simple_bind_s(self.LDAP_BIND_DN, self.LDAP_BIND_PASS)
100
100
101 filt = '(&%s(%s=%s))' % (self.LDAP_FILTER, self.attr_login, username)
101 filt = '(&%s(%s=%s))' % (self.LDAP_FILTER, self.attr_login, username)
102 log.debug("Authenticating %r filt %s at %s", self.BASE_DN, filt, self.LDAP_SERVER)
102 log.debug("Authenticating %r filt %s at %s", self.BASE_DN,
103 lobjects = server.search_ext_s(self.BASE_DN, self.SEARCH_SCOPE, filt)
103 filt, self.LDAP_SERVER)
104 lobjects = server.search_ext_s(self.BASE_DN, self.SEARCH_SCOPE,
105 filt)
104
106
105 if not lobjects:
107 if not lobjects:
106 raise ldap.NO_SUCH_OBJECT()
108 raise ldap.NO_SUCH_OBJECT()
@@ -111,10 +113,12 b' class AuthLdap(object):'
111 break
113 break
112
114
113 except ldap.INVALID_CREDENTIALS, e:
115 except ldap.INVALID_CREDENTIALS, e:
114 log.debug("LDAP rejected password for user '%s' (%s): %s", uid, username, dn)
116 log.debug("LDAP rejected password for user '%s' (%s): %s",
117 uid, username, dn)
115
118
116 else:
119 else:
117 log.debug("No matching LDAP objecs for authentication of '%s' (%s)", uid, username)
120 log.debug("No matching LDAP objects for authentication "
121 "of '%s' (%s)", uid, username)
118 raise LdapPasswordError()
122 raise LdapPasswordError()
119
123
120 except ldap.NO_SUCH_OBJECT, e:
124 except ldap.NO_SUCH_OBJECT, e:
General Comments 0
You need to be logged in to leave comments. Login now