From 41e1f35a8d3eb351deac051b209af6da586b3a4a Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 22 Nov 2006 05:18:54 +0000 Subject: [PATCH] Some acl fixes for ogroups git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5182 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/ogroups/class_ogroupManagement.inc | 32 +++++++++++++------ .../systems/class_workstationStartup.inc | 2 ++ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index 4883ecbb2..cdb83d0ff 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -145,7 +145,7 @@ class ogroupManagement extends plugin /* Load permissions for selected 'dn' and check if we're allowed to remove this 'dn' */ - $acl = $this->ui->get_permissions($this->dn,"ogroup"); + $acl = $this->ui->get_permissions($this->dn,"ogroups"); if(preg_match("/d/",$acl)){ /* Check locking, save current plugin in 'back_plugin', so @@ -176,7 +176,7 @@ class ogroupManagement extends plugin /* Some nice guy may send this as POST, so we've to check for the permissions again. */ - $acl = $this->ui->get_permissions($this->dn,"groups"); + $acl = $this->ui->get_permissions($this->dn,"ogroups"); if(preg_match("/d/",$acl)){ /* Delete request is permitted, perform LDAP action */ @@ -462,16 +462,23 @@ class ogroupManagement extends plugin /* Copy current object to CopyHandler */ if($s_action == "copy"){ + + $this->CopyPasteHandler->Clear(); $dn = $this->ogrouplist[$s_entry]['dn']; - $obj = new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $dn); - $objNew = new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], "new"); - $types_of_tabs = $obj->by_object['ogroup']->gosaGroupObjects; - $objNew->by_object['ogroup']->gosaGroupObjects = $types_of_tabs; - $objNew->reload($types_of_tabs); + /* Check acls */ + $acl_all= $this->ui->has_complete_category_acls($dn,"ogroups"); + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ + $obj = new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $dn); + $objNew = new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], "new"); + + $types_of_tabs = $obj->by_object['ogroup']->gosaGroupObjects; + $objNew->by_object['ogroup']->gosaGroupObjects = $types_of_tabs; + $objNew->reload($types_of_tabs); - $this->CopyPasteHandler->Copy($obj,$objNew); + $this->CopyPasteHandler->Copy($obj,$objNew); + } } /* Copy current object to CopyHandler @@ -479,8 +486,13 @@ class ogroupManagement extends plugin if($s_action == "cut"){ $this->CopyPasteHandler->Clear(); $dn = $this->ogrouplist[$s_entry]['dn']; - $obj = new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $dn); - $this->CopyPasteHandler->Cut($obj); + + /* Check acls */ + $acl_all= $this->ui->has_complete_category_acls($dn,"ogroups"); + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ + $obj = new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $dn); + $this->CopyPasteHandler->Cut($obj); + } } } } diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index 53a2fcc88..8c757bcb5 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -52,6 +52,8 @@ class workstartup extends plugin /* Contains all possible server/release/class settings */ var $FAIServRepConfig = array(); + var $CopyPasteVars = array("gotoModules","gotoShares"); + function workstartup ($config, $dn= NULL, $parent= NULL) { plugin::plugin ($config, $dn, $parent); -- 2.30.2