1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

Merged r1231 from trunk.

git-svn-id: http://redmine.rubyforge.org/svn/branches/0.6-stable@1232 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-03-12 17:57:46 +00:00
parent abaeecbaa9
commit a677817003

View File

@ -74,6 +74,8 @@ class User < ActiveRecord::Base
# 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)
# Make sure no one can sign in with an empty password
return nil if password.to_s.empty?
user = find(:first, :conditions => ["login=?", login]) user = find(:first, :conditions => ["login=?", login])
if user if user
# user is already in local database # user is already in local database