| @@ 188-197 (lines=10) @@ | ||
| 185 | ||
| 186 | // We should only be allowed 1 single other credential to |
|
| 187 | // test against. |
|
| 188 | if (count($credentials) > 1) |
|
| 189 | { |
|
| 190 | $this->error = lang('auth.too_many_credentials'); |
|
| 191 | // If an email is present, log the attempt |
|
| 192 | if (! empty($credentials['email'])) |
|
| 193 | { |
|
| 194 | $this->ci->login_model->recordLoginAttempt($credentials['email']); |
|
| 195 | } |
|
| 196 | return false; |
|
| 197 | } |
|
| 198 | ||
| 199 | // Ensure that the fields are allowed validation fields |
|
| 200 | if (! in_array(key($credentials), config_item('auth.valid_fields')) ) |
|
| @@ 216-225 (lines=10) @@ | ||
| 213 | ->where($credentials) |
|
| 214 | ->first(); |
|
| 215 | ||
| 216 | if (! $user) |
|
| 217 | { |
|
| 218 | $this->error = lang('auth.invalid_user'); |
|
| 219 | // If an email is present, log the attempt |
|
| 220 | if (! empty($credentials['email'])) |
|
| 221 | { |
|
| 222 | $this->ci->login_model->recordLoginAttempt($credentials['email']); |
|
| 223 | } |
|
| 224 | return false; |
|
| 225 | } |
|
| 226 | ||
| 227 | // Now, try matching the passwords. |
|
| 228 | $result = password_verify($password, $user['password_hash']); |
|