Przeglądaj źródła

Merge branch 'dev'

master
Guillaume 4 lat temu
rodzic
commit
d9423c5502
1 zmienionych plików z 6 dodań i 1 usunięć
  1. +6
    -1
      common/models/User.php

+ 6
- 1
common/models/User.php Wyświetl plik

@@ -220,7 +220,12 @@ class User extends ActiveRecordCommon implements IdentityInterface
*/
public function verifyEmail($attribute, $params)
{
$user = User::find()->where("email LIKE :email AND id != :id")->params(array(':email' => '%' . $this->email . '%', ':id' => $this->id))->one();
if($this->id) {
$user = User::find()->where("email LIKE :email AND id != :id")->params(array(':email' => '%' . $this->email . '%', ':id' => $this->id))->one();
}
else {
$user = User::find()->where("email LIKE :email")->params(array(':email' => '%' . $this->email . '%'))->one();
}

if ($user) {
$this->addError($attribute, 'Cette adresse email est déjà utilisée par un autre utilisateur ');

Ładowanie…
Anuluj
Zapisz