示例#1
0
 public function actionEmailConfirm($token)
 {
     try {
         $model = new EmailConfirmForm($token);
     } catch (InvalidParamException $e) {
         throw new BadRequestHttpException($e->getMessage());
     }
     if ($model->confirmEmail()) {
         Yii::$app->getSession()->setFlash('success', Yii::t('user/flash', 'Thanks! Your Email is confirmed'));
     } else {
         Yii::$app->getSession()->setFlash('error', Yii::t('user/flash', 'Error! Email confirm is not sent. Try again.'));
     }
     return $this->goHome();
 }
示例#2
0
 public function actionEmailConfirm($token)
 {
     try {
         $model = new EmailConfirmForm($token);
     } catch (InvalidParamException $e) {
         throw new BadRequestHttpException($e->getMessage());
     }
     if ($model->confirmEmail()) {
         Yii::$app->getSession()->setFlash('success', Module::t('module', 'FLASH_EMAIL_CONFIRM_SUCCESS'));
     } else {
         Yii::$app->getSession()->setFlash('error', Module::t('module', 'FLASH_EMAIL_CONFIRM_ERROR'));
     }
     return $this->goHome();
 }
 public function actionActivate($token)
 {
     try {
         $model = new EmailConfirmForm($token);
     } catch (InvalidParamException $e) {
         throw new BadRequestHttpException($e->getMessage());
     }
     if ($model->confirmEmail()) {
         Yii::$app->getSession()->setFlash('success', Module::t('app', 'FLASH_ACTIVATE_TRUE'));
     } else {
         Yii::$app->getSession()->setFlash('error', Module::t('app', 'FLASH_ACTIVATE_FALSE'));
     }
     return $this->goHome();
 }
示例#4
0
 public function testConfirmCorrectToken()
 {
     $form = new EmailConfirmForm($this->users[0]['email_confirm_token']);
     expect('email should be confirmed', $form->confirmEmail())->true();
 }