Fix LDAP on the fly creation. The User object doesn't have a :dn attribute.

Fixes #4918 and adds a test for the behavior.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3485 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2010-02-25 16:19:55 +00:00
parent 39c97279ca
commit 19d4ddf2f2
2 changed files with 32 additions and 1 deletions
+2 -1
View File
@@ -111,7 +111,8 @@ class User < Principal
# user is not yet registered, try to authenticate with available sources
attrs = AuthSource.authenticate(login, password)
if attrs
user = new(*attrs)
attributes = *attrs
user = new(attributes.symbolize_keys.except(:dn))
user.login = login
user.language = Setting.default_language
if user.save