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()); } }