From aa521c5a5a31d901e99c924bfd1861f74d5db2be Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 26 Feb 2010 08:29:20 +0000 Subject: [PATCH] User model should not have to clean up LDAP attributes. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3488 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/auth_source_ldap.rb | 2 +- app/models/user.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/auth_source_ldap.rb b/app/models/auth_source_ldap.rb index 1378d004d..0a5355072 100644 --- a/app/models/auth_source_ldap.rb +++ b/app/models/auth_source_ldap.rb @@ -37,7 +37,7 @@ class AuthSourceLdap < AuthSource if attrs.first && attrs.first[:dn] && authenticate_dn(attrs.first[:dn], password) logger.debug "Authentication successful for '#{login}'" if logger && logger.debug? - return attrs + return [] << attrs.first.except(:dn) end rescue Net::LDAP::LdapError => text raise "LdapError: " + text diff --git a/app/models/user.rb b/app/models/user.rb index 496ca2137..8a69fda00 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -111,8 +111,7 @@ class User < Principal # user is not yet registered, try to authenticate with available sources attrs = AuthSource.authenticate(login, password) if attrs - attributes = *attrs - user = new(attributes.symbolize_keys.except(:dn)) + user = new(*attrs) user.login = login user.language = Setting.default_language if user.save -- 2.39.5