Exemplo n.º 1
0
 /**
  * @return void
  */
 public function addAction()
 {
     $form = new Logic_Ws_Service_SaveIP_Form_Generic();
     if ($this->getRequest()->isPost()) {
         $post = $this->getRequest()->getPost();
         if ($form->isCancelled($post)) {
             return $this->_helper->redirector('index', null, null);
         }
         if ($form->isValid($post)) {
             try {
                 $clients = is_array($form->getValue('clients')) ? $form->getValue('clients') : array();
                 $this->_model->addIP($form->getValue('ip'), $form->getValue('ip_comment'), $clients);
                 $this->_helper->messenger->success();
                 $this->_helper->redirector('index');
                 return;
             } catch (Logic_Ws_Exception $e) {
                 $this->_helper->messenger->error($e->getMessage());
             }
         }
     }
     $this->view->form = $form;
 }