@@ -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 |
|
|
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