Update Register page for emails from OAuth

This commit is contained in:
Visman 2023-05-19 20:58:24 +07:00
parent f0c1bd9d38
commit 3142ba2c3a
3 changed files with 17 additions and 6 deletions

View file

@ -55,13 +55,23 @@ class Register extends Page
if ($v->validation($_POST, true)) {
// завершение регистрации
if (1 === $v->on) {
$userInDB = $this->c->users->loadByEmail($v->email);
$userInDB = $this->c->users->loadByEmail($v->email);
if ($userInDB instanceof User) {
return $this->regDupe($v, $userInDB);
} else {
return $this->regEnd($v);
}
$id = $this->c->providerUser->findByEmail($v->email);
if ($id > 0) {
$userInDB = $this->c->users->load($id);
if ($userInDB instanceof User) {
return $this->regDupe($v, $userInDB);
}
}
return $this->regEnd($v);
}
} else {
$this->fIswev = $v->getErrors();
@ -306,6 +316,7 @@ class Register extends Page
'fRootLink' => $this->c->Router->link('Index'),
'fMailer' => __(['Mailer', $this->c->config->o_board_title]),
'username' => $v->username,
'email' => $v->eamil,
'ip' => $this->user->ip,
'userInDB' => $userInDB->username,
];

View file

@ -1,6 +1,6 @@
Subject: Alert - Duplicate email detected
User '{!username!}' [{!ip!}] tries to register with an email address that belongs to user '{!userInDB!}'.
User '{!username!}' [{!ip!}] tries to register with an email address '{!email!}' that belongs to user '{!userInDB!}'.
Forums at {!fRootLink!}

View file

@ -1,6 +1,6 @@
Subject: Внимание - Обнаружено повторение адреса email
Subject: Внимание - Обнаружено повторение электронного адреса
Пользователь '{!username!}' [{!ip!}] пытается зарегистрироваться с адресом email, который принадлежит пользователю '{!userInDB!}'.
Пользователь '{!username!}' [{!ip!}] пытается зарегистрироваться с электронным адресом '{!email!}', который принадлежит пользователю '{!userInDB!}'.
Форум по адресу {!fRootLink!}