예제 #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();
 }
예제 #3
0
 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();
 }