mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
Merge pull request #422 from openclassify/dia
#1074 Add country select for login
This commit is contained in:
commit
f58c3287d9
@ -43,7 +43,13 @@ class ValidateCredentials
|
|||||||
|
|
||||||
//Is email or phone number
|
//Is email or phone number
|
||||||
if (!filter_var($credentials['email'], FILTER_VALIDATE_EMAIL)) {
|
if (!filter_var($credentials['email'], FILTER_VALIDATE_EMAIL)) {
|
||||||
if ($user = $this->repository->findBy('gsm_phone', $credentials['email'])) {
|
$possiblePhone = $credentials['email'];
|
||||||
|
if (substr($credentials['email'], 0, 1) == 0) {
|
||||||
|
$possiblePhone = substr($credentials['email'], 1);
|
||||||
|
}
|
||||||
|
if ($user = $this->repository
|
||||||
|
->newQuery()
|
||||||
|
->where('gsm_phone', 'LIKE', "%$possiblePhone")->first()) {
|
||||||
$credentials['email'] = $user->email;
|
$credentials['email'] = $user->email;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user