From 8f66c03fd770344483845e6b32f5bc125b5adb44 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 23 Dec 2009 15:09:11 +0000 Subject: [PATCH] Implemented ACL removal git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14945 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../plugins/admin/acl/class_aclManagement.inc | 51 +++++++++++++++++-- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/gosa-core/plugins/admin/acl/class_aclManagement.inc b/gosa-core/plugins/admin/acl/class_aclManagement.inc index e0a508622..cafc830bb 100644 --- a/gosa-core/plugins/admin/acl/class_aclManagement.inc +++ b/gosa-core/plugins/admin/acl/class_aclManagement.inc @@ -41,12 +41,12 @@ class aclManagement extends management $this->storagePoints = array(get_ou("aclRoleRDN")); // ACLs are attached to department containers // Build filter -# if (session::global_is_set(get_class($this)."_filter")){ -# $filter= session::global_get(get_class($this)."_filter"); -# } else { + if (session::global_is_set(get_class($this)."_filter")){ + $filter= session::global_get(get_class($this)."_filter"); + } else { $filter = new filter(get_template_path("acl-filter.xml", true)); $filter->setObjectStorage($this->storagePoints); -# } + } $this->setFilter($filter); // Build headpage @@ -65,6 +65,49 @@ class aclManagement extends management parent::__construct($config, $ui, "acl", $headpage); } + function removeEntryConfirmed($action="",$target=array(),$all=array(), + $altTabClass="",$altTabType="",$altAclCategory="") + { + $tabType = $this->tabType; + $tabClass = $this->tabClass; + $aclCategory = $this->aclCategory; + $this->config->data['TABS'][$this->tabType] = NULL; + + @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$target,"Entry removel confirmed!"); + + $headpage = $this->getHeadpage(); + foreach($this->dns as $key => $dn){ + + // Check permissions, are we allowed to remove this object? + $acl = $this->ui->get_permissions($dn, $this->aclCategory."/".$this->aclPlugin); + if(preg_match("/d/",$acl)){ + + if($headpage->getType($dn) == "gosaRole"){ + $tabClass = "aclroletab"; + }else{ + $tabClass = "acltab"; + } + + // Delete the object + $this->dn = $dn; + $this->tabObject= new $tabClass($this->config,$this->config->data['TABS'][$tabType], $this->dn, $aclCategory, true, true); + $this->tabObject->set_acl_base($this->dn); + $this->tabObject->delete (); + $this->tabObject->parent = &$this; + + // Remove the lock for the current object. + del_lock($this->dn); + } else { + msg_dialog::display(_("Permission error"), msgPool::permDelete(), ERROR_DIALOG); + new log("security","groups/".get_class($this),$dn,array(),"Tried to trick deletion."); + } + } + + // Cleanup + $this->remove_lock(); + $this->closeDialogs(); + } + function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="") { -- 2.30.2