Stringify User.try_to_login arguments.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9799 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-06-10 13:24:28 +00:00
parent be4ad60058
commit c47293edb1
1 changed files with 4 additions and 1 deletions

View File

@ -130,8 +130,11 @@ class User < Principal
# Returns the user that matches provided login and password, or nil
def self.try_to_login(login, password)
login = login.to_s
password = password.to_s
# Make sure no one can sign in with an empty password
return nil if password.to_s.empty?
return nil if password.empty?
user = find_by_login(login)
if user
# user is already in local database