public function process(IRequest $request)
 {
     if ($request->isPosted()) {
         $form = (new AuthorizationForm())->import($request->getPostParameters());
         if ($form->isValid()) {
             $this->authorize($form);
             $this->getRenderer()->render('index', new RedirectResponse('index'));
         }
     }
     $this->getRenderer()->render('authorization', new NullResponse());
 }
Example #2
0
 public function process(IRequest $request)
 {
     if ($request->isPosted()) {
         $form = (new AddCommentForm())->import($request->getPostParameters());
         if ($form->isValid()) {
             try {
                 $this->addComment($form);
             } catch (Exception $e) {
                 echo 'Bad SQL request';
             }
             $this->getRenderer()->render('viewPost', new RedirectResponse('viewPost', array('post_id' => $form->getPostId())));
         }
     }
     $this->getRenderer()->render('404', new NullResponse());
 }
Example #3
0
 public function process(IRequest $request)
 {
     if ($request->isPosted()) {
         $form = (new AddPostForm())->import($request->getPostParameters());
         if ($form->isValid()) {
             try {
                 $this->addPost($form);
             } catch (Exception $e) {
                 echo 'Bad SQL request';
             }
             $this->getRenderer()->render('index', new RedirectResponse('index'));
         }
     }
     $this->getRenderer()->render('addPost', new NullResponse());
 }