示例#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', Module::t('module', 'FLASH_EMAIL_CONFIRM_SUCCESS'));
     } else {
         Yii::$app->getSession()->setFlash('error', Module::t('module', 'FLASH_EMAIL_CONFIRM_ERROR'));
     }
     return $this->goHome();
 }
示例#2
0
 public function testConfirmCorrectToken()
 {
     $form = new EmailConfirmForm($this->users[0]['email_confirm_token']);
     expect('email should be confirmed', $form->confirmEmail())->true();
 }