Beispiel #1
0
 public function shareAction()
 {
     $request = $this->getRequest();
     $id = $request->getParam('id');
     $id = $this->_helper->IdConvert->hexToStr($id);
     $logic = new Logic_Filter();
     $form = new Logic_Filter_Form_Roles();
     if ($request->isPost()) {
         if ($form->isCancelled($this->getRequest()->getPost())) {
             $this->_helper->redirector('index', null, null);
             return;
         } elseif ($form->isValid($request->getPost())) {
             try {
                 $logic->shareFilter($form, $id);
                 $this->_helper->messenger("success", 'Successfully edited roles having access to the filter.');
                 $this->_helper->redirector('index');
                 return;
             } catch (Logic_User_Exception $e) {
                 $this->_helper->messenger('error', MSG_ERROR, $e);
             }
         }
     } else {
         $defaults = $logic->getRolesForFilter($id);
         $form->setDefaults($defaults);
     }
     $this->view->form = $form;
 }