added registration process
This commit is contained in:
@ -46,41 +46,4 @@ class ResendForm extends Model
|
||||
'email' => Yii::t('user', 'Email'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new confirmation token and sends it to the user.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function resend()
|
||||
{
|
||||
if (!$this->validate()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$user = $this->userQuery->whereEmail($this->email)->one();
|
||||
|
||||
$user = $this->finder->findUserByEmail($this->email);
|
||||
|
||||
if ($user instanceof User && !$user->isConfirmed) {
|
||||
/** @var Token $token */
|
||||
$token = \Yii::createObject([
|
||||
'class' => Token::className(),
|
||||
'user_id' => $user->id,
|
||||
'type' => Token::TYPE_CONFIRMATION,
|
||||
]);
|
||||
$token->save(false);
|
||||
$this->mailer->sendConfirmationMessage($user, $token);
|
||||
}
|
||||
|
||||
\Yii::$app->session->setFlash(
|
||||
'info',
|
||||
\Yii::t(
|
||||
'user',
|
||||
'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.'
|
||||
)
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user