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:
parent
be4ad60058
commit
c47293edb1
@ -130,8 +130,11 @@ class User < Principal
|
|||||||
|
|
||||||
# Returns the user that matches provided login and password, or nil
|
# Returns the user that matches provided login and password, or nil
|
||||||
def self.try_to_login(login, password)
|
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
|
# 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)
|
user = find_by_login(login)
|
||||||
if user
|
if user
|
||||||
# user is already in local database
|
# user is already in local database
|
||||||
|
Loading…
x
Reference in New Issue
Block a user