Пример #1
0
 public function editAction()
 {
     $roleId = $this->_getParam('id');
     $roleRow = $this->aclModel->getRoleById($roleId);
     if (!$roleRow or $roleRow->getIsSystemRole()) {
         throw new Exception('Invalid role');
     }
     $this->view->roleRow = $roleRow;
     $this->view->roleRowData = array('roleName' => $roleRow->getLongDescription());
     if (!$this->getRequest()->isPost()) {
         return;
     }
     $this->view->roleRowData = $roleRowData = $this->_getAllParams();
     $update = $this->aclModel->updateRole($roleRow, $roleRowData);
     if (!$update['status']) {
         $this->view->messageError = $update['messageError'];
         return;
     }
     $this->view->roleUpdateSucess = true;
     $this->_forward('index');
 }