X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fplugins%2Fadmin%2Facl%2Fclass_aclManagement.inc;h=d43c66a0160e74bef3e7b1aa45f5bcac47219d26;hb=1d001e2b73098d61889d035b72239e2e5a69a58f;hp=e0a5086220df5375badb6430060a11bdb7b474c4;hpb=4a3d0cdc5669a4cebb8683a09634f6fabeccf304;p=gosa.git diff --git a/gosa-core/plugins/admin/acl/class_aclManagement.inc b/gosa-core/plugins/admin/acl/class_aclManagement.inc index e0a508622..d43c66a01 100644 --- a/gosa-core/plugins/admin/acl/class_aclManagement.inc +++ b/gosa-core/plugins/admin/acl/class_aclManagement.inc @@ -28,12 +28,12 @@ class aclManagement extends management // Tab definition protected $tabClass = "aclroletab"; - protected $tabType = "ACLROLETABS"; + protected $tabType = "ACLROLETAB"; protected $aclCategory = "acl"; protected $aclPlugin = "acl"; protected $objectName = "acl"; - function __construct($config,$ui) + function __construct(&$config,$ui) { $this->config = $config; $this->ui = $ui; @@ -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 @@ -62,25 +62,74 @@ class aclManagement extends management $this->snapHandler = new SnapshotHandler($this->config); } - parent::__construct($config, $ui, "acl", $headpage); + parent::__construct($this->config, $ui, "acl", $headpage); + } + + function removeEntryConfirmed($action="",$target=array(),$all=array(), + $altTabClass="",$altTabType="",$altAclCategory="") + { + @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"; + $tabTape = "ACLROLETAB"; + }else{ + $tabClass = "acltab"; + $tabTape = "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 newEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="") + { + $this->skipFooter = TRUE; + $altTabClass = "aclroletab"; + $altTabType = "ACLROLETAB"; + return(management::newEntry($action,$target,$all,$altTabClass,$altTabType,$altAclCategory)); + } + function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="") { $this->skipFooter = TRUE; if(count($target) == 1){ // Set dummy tab object... - $this->config->data['TABS'][$this->tabType] = NULL; $this->dn = array_pop($target); $headpage = $this->getHeadpage(); if($headpage->getType($this->dn) == "gosaRole"){ $altTabClass = "aclroletab"; + $altTabType = "ACLROLETAB"; }else{ $altTabClass = "acltab"; + $altTabType = "ACLTAB"; } - management::editEntry($action,array($this->dn),$all,$altTabClass,$altTabType,$altAclCategory); + return(management::editEntry($action,array($this->dn),$all,$altTabClass,$altTabType,$altAclCategory)); } }