From 4b45577aa0d449c2d36417afa256441f9dcb503f Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 22 Nov 2006 12:04:05 +0000 Subject: [PATCH] Some mimetype acl fixes. Fixed acl C&P detection for user/groups/ogroups git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5192 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_applicationManagement.inc | 20 +++++++--------- .../admin/groups/class_groupManagement.inc | 8 +++---- .../mimetypes/class_mimetypeManagement.inc | 24 +++++++++++++------ plugins/admin/mimetypes/generic.tpl | 24 +++++++++---------- plugins/admin/users/class_divListUsers.inc | 4 ++-- plugins/admin/users/class_userManagement.inc | 8 +++---- 6 files changed, 47 insertions(+), 41 deletions(-) diff --git a/plugins/admin/applications/class_applicationManagement.inc b/plugins/admin/applications/class_applicationManagement.inc index 4ba527185..801ca3fe6 100644 --- a/plugins/admin/applications/class_applicationManagement.inc +++ b/plugins/admin/applications/class_applicationManagement.inc @@ -452,16 +452,14 @@ class applicationManagement extends plugin if($s_action == "copy"){ $this->CopyPasteHandler->Clear(); $dn = $this->applications[$s_entry]['dn']; - + /* Check Acls */ $acl_all= $this->ui->has_complete_category_acls($dn,"application"); - if(!preg_match("/(c.*w|w.*c)/",$acl_all)){ - return(""); + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ + $obj = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn, "application"); + $objNew = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], "new","application"); + $this->CopyPasteHandler->Copy($obj,$objNew); } - - $obj = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn, "application"); - $objNew = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], "new","application"); - $this->CopyPasteHandler->Copy($obj,$objNew); } /* Copy current object to CopyHandler @@ -472,12 +470,10 @@ class applicationManagement extends plugin /* Check Acls */ $acl_all= $this->ui->has_complete_category_acls($dn,"application"); - if(!preg_match("/(c.*w|w.*c)/",$acl_all)){ - return(""); + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ + $obj = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn, "application"); + $this->CopyPasteHandler->Cut($obj); } - - $obj = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn, "application"); - $this->CopyPasteHandler->Cut($obj); } } diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc index d3af7a032..0fab284e7 100644 --- a/plugins/admin/groups/class_groupManagement.inc +++ b/plugins/admin/groups/class_groupManagement.inc @@ -508,8 +508,8 @@ class groupManagement extends plugin if($s_action == "copy"){ $dn = $this->grouplist[trim($s_entry)]['dn']; - $acl = $this->ui->get_permissions($dn,"groups/group"); - if(preg_match("/(c.*w|w.*c)/",$acl)){ + $acl_all = $ui->has_complete_category_acls($this->selectedBase,"groups") ; + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ $this->CopyPasteHandler->Clear(); $obj = new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $dn); @@ -529,8 +529,8 @@ class groupManagement extends plugin if($s_action == "cut"){ $dn = $this->grouplist[trim($s_entry)]['dn']; - $acl = $this->ui->get_permissions($dn,"groups/group"); - if(preg_match("/(c.*w|w.*c)/",$acl)){ + $acl_all = $ui->has_complete_category_acls($this->selectedBase,"groups") ; + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ $this->CopyPasteHandler->Clear(); $obj= new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $dn); diff --git a/plugins/admin/mimetypes/class_mimetypeManagement.inc b/plugins/admin/mimetypes/class_mimetypeManagement.inc index 3ee002eca..3f04ac0aa 100755 --- a/plugins/admin/mimetypes/class_mimetypeManagement.inc +++ b/plugins/admin/mimetypes/class_mimetypeManagement.inc @@ -446,11 +446,16 @@ class mimetypeManagement extends plugin if($s_action == "copy"){ $this->CopyPasteHandler->Clear(); $dn = $this->mimetypes[$s_entry]['dn']; - $obj = new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $dn,"mimetypes"); - $obj->set_acl_base($this->dn); - $objNew = new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], "new","mimetypes"); - $objNew->set_acl_base($this->dn); - $this->CopyPasteHandler->Copy($obj,$objNew); + + /* Check acls */ + $acl_all= $this->ui->has_complete_category_acls($dn,"ogroups"); + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ + $obj = new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $dn,"mimetypes"); + $obj->set_acl_base($this->dn); + $objNew = new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], "new","mimetypes"); + $objNew->set_acl_base($this->dn); + $this->CopyPasteHandler->Copy($obj,$objNew); + } } /* Copy current object to CopyHandler @@ -458,8 +463,13 @@ class mimetypeManagement extends plugin if($s_action == "cut"){ $this->CopyPasteHandler->Clear(); $dn = $this->mimetypes[$s_entry]['dn']; - $obj = new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $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 mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $dn); + $this->CopyPasteHandler->Cut($obj); + } } } diff --git a/plugins/admin/mimetypes/generic.tpl b/plugins/admin/mimetypes/generic.tpl index 50a83fa6c..f61803d9e 100644 --- a/plugins/admin/mimetypes/generic.tpl +++ b/plugins/admin/mimetypes/generic.tpl @@ -6,7 +6,6 @@ - +{if !$isReleaseMimeType} +{/if}
@@ -40,23 +39,24 @@ {/render}
-{render acl=$baseACL} - -{/render} -{if !$isReleaseMimeType} -{render acl=$baseACL disable_picture='images/folder_gray.png'} - -{/render} -{/if} + {render acl=$baseACL} + + {/render} + {/if}
diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc index c6accea23..3edbf604d 100644 --- a/plugins/admin/users/class_divListUsers.inc +++ b/plugins/admin/users/class_divListUsers.inc @@ -104,7 +104,7 @@ class divListUsers extends MultiSelectWindow } /* Get copy & paste icon */ - $acl_all = $ui->has_complete_category_acls($this->selectedBase,"users/user") ; + $acl_all = $ui->has_complete_category_acls($this->selectedBase,"users") ; $acl = $ui->get_permissions($this->selectedBase,"users/user"); if(preg_match("/(c.*w|w.*c)/",$acl_all) && $this->parent->CopyPasteHandler){ $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon(); @@ -243,7 +243,7 @@ class divListUsers extends MultiSelectWindow $action= ""; /* Add copy & cut icons */ - $acl_all = $ui->has_complete_category_acls($this->selectedBase,"users/user") ; + $acl_all = $ui->has_complete_category_acls($this->selectedBase,"users") ; $acl = $ui->get_permissions($val['dn'],"users/user"); if(preg_match("/(c.*w|w.*c)/",$acl_all) && $this->parent->CopyPasteHandler){ $action .= "list[trim($s_entry)]['dn']; /* Check acl */ - $acl = $this->ui->get_permissions($dn,"users/user"); - if(preg_match("/(c.*w|w.*c)/",$acl)){ + $acl_all = $ui->has_complete_category_acls($this->selectedBase,"users") ; + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ $obj = new usertabs($this->config, $this->config->data['TABS']['USERTABS'], $dn); $obj->set_acl_base($dn); $objNew = new usertabs($this->config, $this->config->data['TABS']['USERTABS'], "new"); @@ -847,8 +847,8 @@ class userManagement extends plugin $dn= $this->list[trim($s_entry)]['dn']; /* Check acl */ - $acl = $this->ui->get_permissions($dn,"users/user"); - if(preg_match("/(c.*w|w.*c)/",$acl)){ + $acl_all = $ui->has_complete_category_acls($this->selectedBase,"users") ; + if(preg_match("/(c.*w|w.*c)/",$acl_all)){ $obj= new usertabs($this->config, $this->config->data['TABS']['USERTABS'], $dn); $obj->set_acl_base($dn); $this->CopyPasteHandler->Cut($obj); -- 2.30.2