Ejemplo n.º 1
0
 /**
  * @param int    $uid
  * @param string $token
  */
 public function actionUnlock($uid, $token)
 {
     $this->checkParameterAndRedirectIfNull($uid);
     $this->checkParameterAndRedirectIfNull($token);
     try {
         $this->userRepository->unlock($uid, $token);
         $this->flashMessage($this->translator->translate('locale.sign.account_activated'));
     } catch (UserNotFoundException $e) {
         Logger::log($e->getMessage());
         $this->flashTypeWithRedirect($e->getMessage(), FlashType::WARNING, 'Homepage:default');
     } catch (ActivationLimitExpiredException $e) {
         Logger::log($e->getMessage());
         $this->flashTypeWithRedirect($e->getMessage(), FlashType::WARNING, 'Homepage:default');
     } catch (\Exception $e) {
         Logger::log($e->getMessage());
         $this->flashTypeWithRedirect($this->translator->translate('locale.error.occurred'), FlashType::WARNING, 'Homepage:default');
     }
     $this->redirect('Homepage:default');
 }
Ejemplo n.º 2
0
 /**
  * @param Form       $form
  * @param \Exception $e
  * @param string     $output
  */
 protected function addFormError(Form $form, \Exception $e, $output = null)
 {
     $msg = $e->getMessage();
     Logger::log($msg);
     $form->addError($output ? $this->translator->translate('locale.error.occurred') : $msg);
 }