@@ -132,7 +132,8 class User < Principal | |||
|
132 | 132 | def self.try_to_login(login, password) |
|
133 | 133 | # Make sure no one can sign in with an empty password |
|
134 | 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 | 137 | if user |
|
137 | 138 | # user is already in local database |
|
138 | 139 | return nil if !user.active? |
General Comments 0
You need to be logged in to leave comments.
Login now