From 07a5d69cdd9cde8e8dfbd658d7ca9c92e3f8f95b Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 3 Jul 2007 12:58:57 +0000 Subject: [PATCH] Udpated mimetype acls git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6753 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/groups/acl_definition.inc | 2 +- .../admin/mimetypes/class_mimetypeGeneric.inc | 26 ------------------- .../mimetypes/class_mimetypeManagement.inc | 21 +++++++-------- 3 files changed, 11 insertions(+), 38 deletions(-) diff --git a/plugins/admin/groups/acl_definition.inc b/plugins/admin/groups/acl_definition.inc index 0bba710c6..0cb3e7dcb 100644 --- a/plugins/admin/groups/acl_definition.inc +++ b/plugins/admin/groups/acl_definition.inc @@ -455,5 +455,5 @@ $ACLD['scalix'] = array( "scalixLimitNotifyUser" => _("Notify user"), "scalixEmailAddress" => _("Scalix email addresses")); - +$ACLD['mimetype'] = array("create","remove","cn","gotoMimeApplication","gotoMimeLeftClickAction","gotoMimeIcon","description","gotoMimeFilePattern","gotoMimeEmbeddedApplication","gotoMimeGroup","gotoMimeFilePattern","gotoMimeApplication","gotoMimeEmbeddedApplication"); ?> diff --git a/plugins/admin/mimetypes/class_mimetypeGeneric.inc b/plugins/admin/mimetypes/class_mimetypeGeneric.inc index 7a803015a..90616a41c 100644 --- a/plugins/admin/mimetypes/class_mimetypeGeneric.inc +++ b/plugins/admin/mimetypes/class_mimetypeGeneric.inc @@ -157,7 +157,6 @@ class mimetype extends plugin $this->view_logged =TRUE; } - $tmp = $this->plInfo(); foreach($this->attributes as $name){ $smarty->assign($name."ACL", chkacl($this->acl,$name)); } @@ -668,31 +667,6 @@ class mimetype extends plugin } } - /* Return plugin informations for acl handling */ - function plInfo() - { - return (array( - "plShortName" => _("Generic"), - "plDescription" => _("Mime type generic"), - "plSelfModify" => FALSE, - "plDepends" => array(), - "plPriority" => 0, - "plSection" => array("administration"), - "plCategory" => array("mimetypes" => array("description" => _("Mime types"), - "objectClass" => "gotoMimeType")), - "plProvidedAcls"=> array( - "cn" => _("Name"), - "gotoMimeGroup" => _("Mime group"), - "description" => _("Description"), - "base" => _("Base"), - "gotoMimeApplication" => _("Application"), - "gotoMimeLeftClickAction" => _("Left click action"), - "gotoMimeIcon" => _("Icon"), - "gotoMimeFilePattern" => _("File patterns"), - "gotoMimeEmbeddedApplication" => _("Embedded applications")) - )); - - } function PrepareForCopyPaste($source) { diff --git a/plugins/admin/mimetypes/class_mimetypeManagement.inc b/plugins/admin/mimetypes/class_mimetypeManagement.inc index f4bf712fc..f9a58748f 100755 --- a/plugins/admin/mimetypes/class_mimetypeManagement.inc +++ b/plugins/admin/mimetypes/class_mimetypeManagement.inc @@ -254,7 +254,7 @@ class mimetypeManagement extends plugin $this->mimetabs= new mimetabs($this->config,$this->config->data['TABS']['MIMETABS'], $this->dn); /* Set up the users ACL's for this 'dn' */ - $acl= get_permissions ($this->DivListMimeTypes->selectedBase, $this->ui->subtreeACL); + $acl= get_permissions ($this->dn, $this->ui->subtreeACL); $this->mimetabs->set_acl($acl); $_SESSION['objectinfo']= $this->dn; @@ -309,8 +309,8 @@ class mimetypeManagement extends plugin /* Load permissions for selected 'dn' and check if we're allowed to remove this 'dn' */ - $acl= get_permissions ($dn, $this->ui->subtreeACL); - $acl= get_module_permission($acl, "mimetypes", $dn); + $acl= get_permissions ($this->dn, $this->ui->subtreeACL); + $acl= get_module_permission($acl, "mimetype", $this->dn); if (chkacl($acl,"remove") == ""){ @@ -344,13 +344,13 @@ class mimetypeManagement extends plugin /* Load permissions for selected 'dn' and check if we're allowed to remove this 'dn' */ - $acl= get_permissions ($dn, $this->ui->subtreeACL); - $acl= get_module_permission($acl, "mimetypes", $dn); - + $acl= get_permissions ($this->dn, $this->ui->subtreeACL); + $acl= get_module_permission($acl, "mimetype", $this->dn); + if (chkacl($acl,"remove") == ""){ /* Delete request is permitted, perform LDAP action */ - $this->mimetabs= new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $this->dn,"mimetypes"); + $this->mimetabs= new mimetabs($this->config, $this->config->data['TABS']['MIMETABS'], $this->dn,"mimetype"); $this->mimetabs->set_acl_base($this->dn); $this->mimetabs->delete (); unset ($this->mimetabs); @@ -361,7 +361,6 @@ class mimetypeManagement extends plugin /* Normally this shouldn't be reached, send some extra logs to notify the administrator */ print_red (_("You are not allowed to delete this mime type!")); - new log("security","mimetypes/".get_class($this),$dn,array(),"Tried to trick deletion."); } /* Remove lock file after successfull deletion */ @@ -491,7 +490,7 @@ class mimetypeManagement extends plugin /* Cleanup object queue */ $this->CopyPasteHandler->cleanup_queue(); $dn = $this->mimetypes[$s_entry]['dn']; - $this->CopyPasteHandler->add_to_queue($dn,$s_action,"mimetabs","MIMETABS","mimetypes"); + $this->CopyPasteHandler->add_to_queue($dn,$s_action,"mimetabs","MIMETABS","mimetype"); } /* Add entries to queue */ @@ -505,10 +504,10 @@ class mimetypeManagement extends plugin $dn = $this->mimetypes[$id]['dn']; if($s_action == "copy_multiple"){ - $this->CopyPasteHandler->add_to_queue($dn,"copy","mimetabs","MIMETABS","mimetypes"); + $this->CopyPasteHandler->add_to_queue($dn,"copy","mimetabs","MIMETABS","mimetype"); } if($s_action == "cut_multiple"){ - $this->CopyPasteHandler->add_to_queue($dn,"cut","mimetabs","MIMETABS","mimetypes"); + $this->CopyPasteHandler->add_to_queue($dn,"cut","mimetabs","MIMETABS","mimetype"); } } } -- 2.30.2