protected function handlePreDelete($id, $values) { // remove acls $acl = new Acl(); $searchcriteria = array('grp_id' => $id['id']); $acl->delete($searchcriteria); // remove users $this->removeUser($id); }
public function handleDeleteObjects($id) { // remove all reference objects $sitePlugin = $this->getSitePlugin(); $siteTag = $this->getSiteTag(); $siteTheme = $this->getSiteTheme(); $acl = new Acl(); $searchKey = array('tree_id' => $id['id']); $this->handleDeleteObject($searchKey, $sitePlugin); //$this->handleDeleteObject($searchKey, $siteTag); //$this->handleDeleteObject($searchKey, $siteTheme); $siteTag->delete($searchKey); $siteTheme->delete($searchKey); $acl->delete($searchKey); }
private function handleAdminEditRootAclPost() { $request = Request::getInstance(); $values = $request->getRequest(Request::POST); try { if (!$request->exists('id')) { throw new Exception('Node ontbreekt.'); } $id = intval($request->getValue('id')); $isRootNode = $id == $this->tree->getRootId(); // check if user has execute rights $auth = Authentication::getInstance(); if (!$auth->canModify($id)) { throw new HttpException('403'); } $key = array('id' => $id); if (!$isRootNode) { $this->update($key, $values); } if ($auth->isRole(SystemUser::ROLE_ADMIN)) { $acl = new Acl(); $acl->delete(array('tree_id' => $id)); $groupSelect = $request->getValue('acl'); if (is_array($groupSelect)) { foreach ($groupSelect as $grp_id => $rightsList) { $rights = 0; foreach ($rightsList as $item) { $rights |= $item; } $aclValues = array('tree_id' => $id, 'grp_id' => $grp_id, 'rights' => $rights); $acl->insert($aclValues); } } } viewManager::getInstance()->setType(ViewManager::ADMIN_OVERVIEW); $this->handleAdminOverview($id); } catch (Exception $e) { $template = new TemplateEngine(); $template->setVariable('errorMessage', $e->getMessage(), false); if (!$isRootNode) { // reset date values $online = $this->sqlParser->getFieldByName('online'); $this->sqlParser->setFieldValue('online', $online->getValue() ? strftime('%Y-%m-%d', strtotime($online->getValue())) : ''); $offline = $this->sqlParser->getFieldByName('offline'); $this->sqlParser->setFieldValue('offline', $offline->getValue() ? strftime('%Y-%m-%d', strtotime($offline->getValue())) : ''); } $this->handleAdminEditGet(false); } }