Browse Source

Problème connexion User de type LEGAL_PERSON #560

refactoring
Guillaume Bourgeois 2 years ago
parent
commit
f29cd8b62f
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      common/models/LoginForm.php

+ 7
- 1
common/models/LoginForm.php View File

@@ -121,7 +121,13 @@ class LoginForm extends Model
public function getUser()
{
if ($this->_user === false) {
$this->_user = User::findOne(['email' => $this->email, 'type' => User::TYPE_INDIVIDUAL]);
$this->_user = User::searchOne(
['email' => $this->email],
[
'conditions' => 'type LIKE :type_individual OR type LIKE :type_legal_person',
'params' => [':type_individual' => User::TYPE_INDIVIDUAL, ':type_legal_person' => User::TYPE_LEGAL_PERSON]
]
);
}

return $this->_user;

Loading…
Cancel
Save