예제 #1
0
 /**
  * Receive token, find user by it and confirm email
  *
  * @param string $token
  *
  * @throws \yii\web\NotFoundHttpException
  * @return string|\yii\web\Response
  */
 public function actionConfirmEmailReceive($token)
 {
     $user = User::findByConfirmationToken($token);
     if (!$user) {
         throw new NotFoundHttpException(UserManagementModule::t('front', 'Token not found. It may be expired'));
     }
     $user->email_confirmed = 1;
     $user->removeConfirmationToken();
     $user->save(false);
     return $this->renderIsAjax('confirmEmailSuccess', compact('user'));
 }