Exemple #1
0
 public function getEmailConfirmToken()
 {
     return $this->hasOne(UserEmailConfirmToken::className(), ['user_id' => 'id']);
 }
Exemple #2
0
 public function actionConfirmEmail($token)
 {
     $tokenModel = UserEmailConfirmToken::findToken($token);
     if ($tokenModel) {
         Yii::$app->getSession()->setFlash('success', $tokenModel->confirm($token));
     } else {
         Yii::$app->getSession()->setFlash('error', Yii::t('users', 'CONFIRMATION_LINK_IS_WRONG'));
     }
     return $this->redirect(Url::toRoute('/login'));
 }