##// END OF EJS Templates
Implements the behaviour expected in user_test....
Jean-Philippe Lang -
r8909:df3c2466f8ca
parent child
Show More
@@ -132,7 +132,8 class User < Principal
132 def self.try_to_login(login, password)
132 def self.try_to_login(login, password)
133 # Make sure no one can sign in with an empty password
133 # Make sure no one can sign in with an empty password
134 return nil if password.to_s.empty?
134 return nil if password.to_s.empty?
135 user = find_by_login(login)
135 matches = find_all_by_login(login)
136 user = (matches.size < 2 ? matches.first : matches.detect {|u| u.login == login})
136 if user
137 if user
137 # user is already in local database
138 # user is already in local database
138 return nil if !user.active?
139 return nil if !user.active?
General Comments 0
You need to be logged in to leave comments. Login now