Code

Updated acl
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Nov 2006 12:26:46 +0000 (12:26 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Nov 2006 12:26:46 +0000 (12:26 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5193 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/mimetypes/class_divListMimeTypes.inc
plugins/admin/mimetypes/class_mimetypeGeneric.inc

index 3c3a44073f6065accf932a69c003d1e9919e37ae..a491e73c8f80d74ef0c4ce7afb3ba94081c43ae3 100755 (executable)
@@ -200,22 +200,13 @@ class divListMimeTypes extends MultiSelectWindow
       }
 
       /* Get copy Paste icons */
-      if($this->parent->CopyPasteHandler){
-
-        /* Only add cut icon, if we are allowed to move this user */
-        if(preg_match("/m/",$acl)){
-          $actions.= "<input class='center' type='image'
-            src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
-        }else{
-          $actions.= "<img src='images/empty.png' alt='&nbsp;'>";
-        }
-
-        /* Copy is allowed everytime */
+      if(($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){
+        $actions.= "<input class='center' type='image'
+          src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
         $actions.= "<input class='center' type='image'
           src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'>&nbsp;";
       }
 
-      /* Add edit button */
       $actions.= "<input class='center' type='image'
         src='images/edit.png' alt='"._("edit")."' name='mime_edit_%KEY%' title='"._("Edit this entry")."'>";
 
index af3c768f625f578158261a9239459962edf41b9d..f4bb14f11d0380202b8102115a764c538ba8221a 100644 (file)
@@ -295,24 +295,32 @@ class mimetype extends plugin
       $EApps_Actions= "";      
     }
 
-    foreach($this->use_gotoMimeFilePattern as $key => $pattern){
-      $field1 = array("string" => $pattern);
-      $field2 = array("string" => preg_replace("/%s/",$key,$Pattern_Actions),"attach"=>"style='border-right:0px;width:50px;'");
-      $fields = array($field1,$field2);
-      $DivPatterns -> AddEntry($fields);
+    /* Before adding some entries check acls */
+    if($this->acl_is_readable("gotoMimeFilePattern")){
+      foreach($this->use_gotoMimeFilePattern as $key => $pattern){
+        $field1 = array("string" => $pattern);
+        $field2 = array("string" => preg_replace("/%s/",$key,$Pattern_Actions),"attach"=>"style='border-right:0px;width:50px;'");
+        $fields = array($field1,$field2);
+        $DivPatterns -> AddEntry($fields);
+      }                        
+    }
+
+    if($this->acl_is_readable("gotoMimeApplication")){
+      foreach($this->use_gotoMimeApplication as $key => $pattern){
+        $field1 = array("string" => $pattern);
+        $field2 = array("string" => preg_replace("/%s/",$key,$Apps_Actions),"attach"=>"style='border-right:0px;width:50px;'");
+        $fields = array($field1,$field2);
+        $DivApps -> AddEntry($fields);
+      }                        
     }                  
-    foreach($this->use_gotoMimeApplication as $key => $pattern){
-      $field1 = array("string" => $pattern);
-      $field2 = array("string" => preg_replace("/%s/",$key,$Apps_Actions),"attach"=>"style='border-right:0px;width:50px;'");
-      $fields = array($field1,$field2);
-      $DivApps -> AddEntry($fields);
+    if($this->acl_is_readable("gotoMimeEmbeddedApplication")){
+      foreach($this->use_gotoMimeEmbeddedApplication as $key => $pattern){
+        $field1 = array("string" => $pattern);
+        $field2 = array("string" => preg_replace("/%s/",$key,$EApps_Actions),"attach"=>"style='border-right:0px;width:50px;'");
+        $fields = array($field1,$field2);
+        $DivEApps -> AddEntry($fields);
+      }
     }                  
-    foreach($this->use_gotoMimeEmbeddedApplication as $key => $pattern){
-      $field1 = array("string" => $pattern);
-      $field2 = array("string" => preg_replace("/%s/",$key,$EApps_Actions),"attach"=>"style='border-right:0px;width:50px;'");
-      $fields = array($field1,$field2);
-      $DivEApps -> AddEntry($fields);
-    }
     $smarty->assign("bases",                                           $this->get_allowed_bases());            
     $smarty->assign("base_select",                                     $this->base);           
     $smarty->assign("isReleaseMimeType",                       $this->isReleaseMimeType);