X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fogroups%2Fclass_ogroupManagement.inc;h=f3a3ad2593eb9f6bb10cf2e6821a0b876f9d1251;hb=f1ca520daf95525953d6e03c5bb0abf7c2648171;hp=3142979c018c07979473ff3530dcfea6820d0668;hpb=3174f0e39701cf413f6e1befbade42624140f4ef;p=gosa.git diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index 3142979c0..f3a3ad259 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -111,39 +111,12 @@ class ogroupManagement extends plugin Copy & Paste handling ****************/ - /* Only perform copy / paste if it is enabled - */ - if($this->CopyPasteHandler){ - - /* Paste copied/cutted object in here - */ - if(($s_action == "editPaste") || ($this->CopyPasteHandler->stillOpen())){ - $this->CopyPasteHandler->save_object(); - $this->CopyPasteHandler->SetVar("base", $this->DivListOGroup->selectedBase); - return($this->CopyPasteHandler->execute()); - } - - /* 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"); - $this->CopyPasteHandler->Copy($obj,$objNew); - } - - /* Copy current object to CopyHandler - */ - 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); - } + /* Display the copy & paste dialog, if it is currently open */ + $ret = $this->copyPasteHandling($s_action,$s_entry); + if($ret){ + return($ret); } - /**************** Create a new object group ****************/ @@ -156,8 +129,8 @@ class ogroupManagement extends plugin $this->dn= "new"; /* Create new usertab object */ - $this->ogroup= new ogrouptabs($this->config, - $this->config->data['TABS']['OGROUPTABS'], $this->dn); + $this->ogroup= new ogrouptabs($this->config,$this->config->data['TABS']['OGROUPTABS'], $this->dn,"ogroups"); + $this->ogroup->set_acl_base($this->DivListOGroup->selectedBase); } @@ -172,9 +145,8 @@ class ogroupManagement extends plugin /* Load permissions for selected 'dn' and check if we're allowed to remove this 'dn' */ - $acl= get_permissions ($this->dn, $this->ui->subtreeACL); - $this->acl= get_module_permission($acl, "ogroup", $this->dn); - if (chkacl($this->acl, "delete") == ""){ + $acl = $this->ui->get_permissions($this->dn,"ogroup"); + if(preg_match("/d/",$acl)){ /* Check locking, save current plugin in 'back_plugin', so the dialog knows where to return. */ @@ -204,7 +176,8 @@ class ogroupManagement extends plugin /* Some nice guy may send this as POST, so we've to check for the permissions again. */ - if (chkacl($this->acl, "delete") == ""){ + $acl = $this->ui->get_permissions($this->dn,"groups"); + if(preg_match("/d/",$acl)){ /* Delete request is permitted, perform LDAP action */ $this->ogroup= new ogrouptabs($this->config, @@ -258,13 +231,9 @@ class ogroupManagement extends plugin above dialog */ add_lock ($this->dn, $this->ui->dn); - /* Set up the users ACL's for this 'dn' */ - $acl= get_permissions ($this->dn, $this->ui->subtreeACL); - /* Register grouptab to trigger edit dialog */ - $this->ogroup= new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], - $this->dn); - $this->ogroup->set_acl($acl); + $this->ogroup= new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $this->dn, "ogroups"); + $this->ogroup->set_acl_base($this->dn); $_SESSION['objectinfo']= $this->dn; } @@ -346,8 +315,9 @@ class ogroupManagement extends plugin Display list ****************/ - /* Check if there is a snapshot dialog open */ - if($str = $this->showSnapshotDialog($this->DivListOGroup->selectedBase,get_groups_ou())){ + /* Check if there is a snapshot dialog open */ + $base = $this->DivListOGroup->selectedBase; + if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){ return($str); } @@ -365,6 +335,14 @@ class ogroupManagement extends plugin } + /* Return departments, that will be included within snapshot detection */ + function get_used_snapshot_bases() + { + return(array(get_groups_ou().$this->DivListOGroup->selectedBase)); + } + + + function convert_list($input) { $temp= ""; @@ -417,7 +395,7 @@ class ogroupManagement extends plugin function reload() { /* Set base for all searches && initialise some vars */ - $this->oogrouplist= array(); + $this->ogrouplist= array(); $base = $this->DivListOGroup->selectedBase; $filter = "(gosaGroupObjects=[])"; $Regex = $this->DivListOGroup->Regex; @@ -441,9 +419,9 @@ class ogroupManagement extends plugin $filter= "(&(cn=$Regex)(objectClass=gosaGroupOfNames)(|$filter))"; if($this->DivListOGroup->SubSearch){ - $res= get_list($filter, $this->ui->subtreeACL, $base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT | GL_SUBSEARCH); + $res= get_list($filter, "ogroups", $base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT | GL_SUBSEARCH); }else{ - $res= get_list($filter, $this->ui->subtreeACL, get_groups_ou().$base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT ); + $res= get_list($filter, "ogroups", get_groups_ou().$base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT ); } $this->ogrouplist= $res; @@ -461,6 +439,46 @@ class ogroupManagement extends plugin reset ($this->ogrouplist); } + + function copyPasteHandling($s_action,$s_entry) + { + if($this->CopyPasteHandler){ + + /* Paste copied/cutted object in here + */ + if(($s_action == "editPaste") || ($this->CopyPasteHandler->stillOpen())){ + $this->CopyPasteHandler->save_object(); + $this->CopyPasteHandler->SetVar("base", $this->DivListOGroup->selectedBase); + return($this->CopyPasteHandler->execute()); + } + + /* 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); + + $this->CopyPasteHandler->Copy($obj,$objNew); + } + + /* Copy current object to CopyHandler + */ + 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); + } + } + } + + function save_object() { $this->DivListOGroup->save_object();