@@ -74,6 +74,8 class User < ActiveRecord::Base | |||||
74 |
|
74 | |||
75 | # Returns the user that matches provided login and password, or nil |
|
75 | # Returns the user that matches provided login and password, or nil | |
76 | def self.try_to_login(login, password) |
|
76 | def self.try_to_login(login, password) | |
|
77 | # Make sure no one can sign in with an empty password | |||
|
78 | return nil if password.to_s.empty? | |||
77 | user = find(:first, :conditions => ["login=?", login]) |
|
79 | user = find(:first, :conditions => ["login=?", login]) | |
78 | if user |
|
80 | if user | |
79 | # user is already in local database |
|
81 | # user is already in local database |
General Comments 0
You need to be logged in to leave comments.
Login now