Mercurial > kallithea
comparison rhodecode/lib/auth.py @ 1992:335b55caa81d beta
#355 replaced stored LDAP password with some random generated one
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 14 Feb 2012 23:30:40 +0200 |
parents | 87f0800abc7b |
children | 4d3179d2adfe |
comparison
equal
deleted
inserted
replaced
1991:9e0db8d8d616 | 1992:335b55caa81d |
---|---|
222 user_attrs = { | 222 user_attrs = { |
223 'name': safe_unicode(get_ldap_attr('ldap_attr_firstname')), | 223 'name': safe_unicode(get_ldap_attr('ldap_attr_firstname')), |
224 'lastname': safe_unicode(get_ldap_attr('ldap_attr_lastname')), | 224 'lastname': safe_unicode(get_ldap_attr('ldap_attr_lastname')), |
225 'email': get_ldap_attr('ldap_attr_email'), | 225 'email': get_ldap_attr('ldap_attr_email'), |
226 } | 226 } |
227 | 227 |
228 if user_model.create_ldap(username, password, user_dn, | 228 # don't store LDAP password since we don't need it. Override |
229 # with some random generated password | |
230 _password = PasswordGenerator().gen_password(length=8) | |
231 # create this user on the fly if it doesn't exist in rhodecode | |
232 # database | |
233 if user_model.create_ldap(username, _password, user_dn, | |
229 user_attrs): | 234 user_attrs): |
230 log.info('created new ldap user %s' % username) | 235 log.info('created new ldap user %s' % username) |
231 | 236 |
232 Session.commit() | 237 Session.commit() |
233 return True | 238 return True |