/** * Requests confirm email. * * @return mixed */ public function actionNewEmailConfirm($token) { if (empty($token) || !is_string($token)) { throw new InvalidParamException('New email token cannot be blank.'); } $user = UserFrontend::findByNewEmailToken($token); if (!empty($user)) { $user->status = UserFrontend::STATUS_ACTIVE; $user->save(); Yii::$app->getSession()->setFlash('success', 'Успешно! Email адрес подтвержден.'); } else { Yii::$app->getSession()->setFlash('warning', 'Wrong password reset token.!'); //throw new InvalidParamException('Wrong password reset token.'); } return $this->goHome(); }