Code

Updated Mimetypes
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 Jul 2008 08:09:46 +0000 (08:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 21 Jul 2008 08:09:46 +0000 (08:09 +0000)
-Fixed ACL check

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11721 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc
gosa-plugins/goto/admin/mimetypes/generic.tpl

index 0e51158e6fcf146b2cb1a9dd440ec7f65c0600c8..9246366dafe0d16636db54e07119bc607b001bf9 100644 (file)
@@ -160,6 +160,7 @@ class mimetype extends plugin
     foreach($tmp['plProvidedAcls'] as $name => $translation){
       $smarty->assign($name."ACL",$this->getacl($name,preg_match("/freeze/i",$this->FAIstate)));
     }
+    $smarty->assign("IconReadable", preg_match("/r/",$this->getacl("gotoMimeIcon",preg_match("/freeze/i",$this->FAIstate))));
 
     /* Base select dialog */
     $once = true;
@@ -220,6 +221,7 @@ class mimetype extends plugin
             /* Get action vars */
             $func              = $action['Func'];              // Get function name 
             $attr              = $action['Attr'];              // Get attribute name
+            $acl_a             = preg_replace("/^use_/","",$action['Attr']);           // Get attribute name
 
             /* Get entry id */
             $s_entry   = preg_replace($regex,"",$name);
@@ -227,7 +229,7 @@ class mimetype extends plugin
 
             /* Execute a command with the given attribute and entry 
                e.g. $this->gotoMimeFilePattern = $this->ArrayUp(3,$this->gotoMimeFilePattern) */
-            if($this->acl_is_writeable($attr)){
+            if($this->acl_is_writeable($acl_a)){
               $this->$attr= $this->$func($s_entry,$this->$attr,true);                                   
             }
           }
index b66f2429220fe024d83180271fb8d89ffe814e91..e436117d4ab78dd032be28c1ac84a3cd26f891ed 100644 (file)
@@ -12,7 +12,7 @@
                                                {t}Mime type{/t}{$must}
                                        </td>
                                        <td>
-{render acl=$gotoMimeGroupACL}
+{render acl=$cnACL}
                                                <input type="text" name='cn' value="{$cn}" title='{t}Please enter a name for the mime type here{/t}'>
 {/render}
                                        </td>
                                <tr>
                                        <td>
                                                <LABEL for="picture_file">{t}Icon{/t}</LABEL><br>
+{if $IconReadable}
                                                <img src="{$gotoMimeIcon}" border=1 alt='{t}Mime icon{/t}' 
                                                        style="width:48px; height:48; background-color:white; vertical-align:bottom;">
+{else}
+                                               <img src="images/empty.png" border=1 alt='{t}Mime icon{/t}' 
+                                                       style="width:48px; height:48; background-color:white; vertical-align:bottom;">
+{/if}
                                        </td>
                                        <td style="vertical-align:top">
                                                &nbsp;<br>