Example #1
0
 public function newWriterFormSucceeded($form, $values)
 {
     if (!$this->presenter->user->isLoggedIn()) {
         try {
             $this->captchaManager->checkCaptcha($values->captcha);
         } catch (\Exception $e) {
             $this->presenter->flashMessage($e->getMessage());
             $this->presenter->redirect('this');
         }
         $values->byUser = null;
     } else {
         $values->contact = $this->presenter->user->getIdentity()->mail;
         $values->byUser = $this->presenter->user->id;
     }
     try {
         $this->articleManager->addNewWriter($values);
     } catch (\Exception $e) {
         $form->addError($e->getMessage());
     }
 }
Example #2
0
 /**
  * Form OK
  * @param Form $form
  * @param type $values
  */
 public function registerFormSucceeded(Form $form, $values)
 {
     try {
         $this->captchaManager->checkCaptcha($values->captcha);
     } catch (\Exception $e) {
         $this->goHome($e->getMessage(), 'this');
     }
     try {
         $this->userManager->registerNew($values->mail, $values->password, $values->nickName);
     } catch (\Exception $e) {
         $form->addError($e->getMessage());
     }
     if ($form->success) {
         $this->goHome('Registrace byla úspěšná, vyčkejte na ověřovací mail. Můžete se nyní přihlásit.', 'Log:in', [], 'success');
     }
 }
Example #3
0
 public function handleNewCaptcha($comID)
 {
     $this->captchaManager->setNewQuestion();
     $this->template->currentSubComment = $comID;
     $this->redrawAjax(['captchaContainer', 'captchaStatic']);
 }
Example #4
0
 public function actionDefault($t = '', $color = '', $size = '')
 {
     $this->captchaManager->getCaptchaImage($color, $size);
     $this->terminate();
 }