changeset 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 9e0db8d8d616
children 4d3179d2adfe
files rhodecode/lib/auth.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/auth.py	Tue Feb 14 23:09:25 2012 +0200
+++ b/rhodecode/lib/auth.py	Tue Feb 14 23:30:40 2012 +0200
@@ -224,8 +224,13 @@
                  'lastname': safe_unicode(get_ldap_attr('ldap_attr_lastname')),
                  'email': get_ldap_attr('ldap_attr_email'),
                 }
-
-                if user_model.create_ldap(username, password, user_dn,
+                
+                # don't store LDAP password since we don't need it. Override 
+                # with some random generated password
+                _password = PasswordGenerator().gen_password(length=8)
+                # create this user on the fly if it doesn't exist in rhodecode
+                # database
+                if user_model.create_ldap(username, _password, user_dn,
                                           user_attrs):
                     log.info('created new ldap user %s' % username)