##// END OF EJS Templates
Automated merge with https://rhodecode.org/rhodecode
"Lorenzo M. Catucci" -
r1289:f56533aa merge beta
parent child Browse files
Show More
@@ -205,12 +205,12 def authenticate(username, password):
205 205 log.debug('Got ldap DN response %s', user_dn)
206 206
207 207 user_attrs = {
208 'name': ldap_attrs[ldap_settings\
209 .get('ldap_attr_firstname')][0],
210 'lastname': ldap_attrs[ldap_settings\
211 .get('ldap_attr_lastname')][0],
212 'email': ldap_attrs[ldap_settings\
213 .get('ldap_attr_email')][0],
208 'name': ldap_attrs.get(ldap_settings\
209 .get('ldap_attr_firstname'), [''])[0],
210 'lastname': ldap_attrs.get(ldap_settings\
211 .get('ldap_attr_lastname'),[''])[0],
212 'email': ldap_attrs.get(ldap_settings\
213 .get('ldap_attr_email'), [''])[0],
214 214 }
215 215
216 216 if user_model.create_ldap(username, password, user_dn,
@@ -105,9 +105,10 class AuthLdap(object):
105 105 if not lobjects:
106 106 raise ldap.NO_SUCH_OBJECT()
107 107
108 for (dn, attrs) in lobjects:
108 for (dn, _attrs) in lobjects:
109 109 try:
110 110 server.simple_bind_s(dn, password)
111 attrs = server.search_ext_s(dn, ldap.SCOPE_BASE, '(objectClass=*)')[0][1]
111 112 break
112 113
113 114 except ldap.INVALID_CREDENTIALS, e:
General Comments 0
You need to be logged in to leave comments. Login now