Add sending an email to reset the passphrase when trying to re-register

This commit is contained in:
Visman 2023-07-23 10:22:33 +07:00
parent 987b2b4e48
commit 482061f54d

View file

@ -476,6 +476,19 @@ class Register extends Page
&& 1 === $this->c->config->b_regs_verify
) {
$isSent = true;
$flood = \time() - $userInDB->last_email_sent;
// отправка письма на сброс кодовой фразы
// костыль
if ($flood >= $this->c->FLOOD_INTERVAL) {
$_POST = [
'token' => $this->c->Csrf->create('Forget'),
'email' => $email,
'submit' => 'From dupe registration',
];
$this->c->Auth->forget([], 'POST');
}
// письмо активации аккаунта отправлено
if ($isSent) {