Code

Apply patch for #2025
authorpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Sep 2010 12:52:41 +0000 (12:52 +0000)
committerpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Sep 2010 12:52:41 +0000 (12:52 +0000)
Do not check ACLs in the faiDebconfConfigurations class. Instead, do
not display the 'Edit Debconf Configurations' button if the
FAIdebconfInfo ACL is not present for writing, in line with the
faiPackageConfiguration class.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@19552 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-plugins/fai/admin/fai/class_faiDebconfConfigurations.inc
trunk/gosa-plugins/fai/admin/fai/class_faiPackage.inc
trunk/gosa-plugins/fai/admin/fai/faiPackage.tpl

index b376993ca1e81b0d6acd30f303a0c59d4843b00d..bf9d1c6e453ffb184d490158e31841711fe84dec 100644 (file)
@@ -205,8 +205,7 @@ class faiDebconfConfigurations extends plugin
 
         /* Define actions for this entry */ 
         $actions = "";
-        if(!preg_match('/^freeze/', $this->FAIstate) && 
-          $this->acl_is_writeable("FAIdebconfInfo")) {
+        if(!preg_match('/^freeze/', $this->FAIstate)) {
             /* Don't enable actions if no gosa-si defaults available */
             $show_reset = FALSE;
             $show_edit = FALSE;
index 9bf75f59808807ce078fd9f5a2eefc507a51a572..3cf8cc46da98c0a16e46950c0ce7fc4886f7af82 100644 (file)
@@ -55,6 +55,7 @@ class faiPackage extends plugin
 
   var $direct_packages_add = FALSE;
   var $configure_dialog_shown = FALSE;
+  var $debconf_configurations = FALSE;
 
   function faiPackage (&$config, $dn= NULL)
   {
@@ -288,7 +289,7 @@ class faiPackage extends plugin
     }
 
     if(isset($_POST['EditConfigurations']) &&
-      $this->acl_is_writeable("FAIpackage")) {
+      $this->acl_is_writeable("FAIdebconfInfo")) {
         $this->dialog = new faiDebconfConfigurations($this->config, $this->dn, $this);
         $this->dialog->set_acl_base($this->acl_base);
         $this->is_dialog = true;
@@ -535,6 +536,10 @@ class faiPackage extends plugin
     foreach($tmp['plProvidedAcls'] as $name => $translated){
       $smarty->assign($name."ACL",$this->getacl($name,preg_match("/freeze/",$this->FAIstate)));
     }
+
+    if ($this->acl_is_writeable("FAIdebconfInfo")) {
+      $this->debconf_configurations = TRUE;
+    }
  
     $smarty->assign("freeze", preg_match("/freeze/",$this->FAIstate));
     $smarty->assign("divlist",$divlist->DrawList());
@@ -542,6 +547,7 @@ class faiPackage extends plugin
     $smarty->assign("sections",$this->sections);
     $smarty->assign("section" ,$strsec);
     $smarty->assign("direct_packages_add", $this->direct_packages_add);
+    $smarty->assign("debconf_configurations", $this->debconf_configurations);
     $display.= $smarty->fetch(get_template_path('faiPackage.tpl', TRUE));
     return($display);
   }
index 870ae6ea999e2e753ce128320b341fe322abddaf..19c10cf25fe1e25cfef4e095f2cb56bc28a56ce9 100644 (file)
@@ -87,8 +87,9 @@
 {/if}
                </td>
         <td style="text-align: right;">
-        <!-- ToDo: ACL? --!>
+{if $debconf_configurations}
         <input type="submit" name="EditConfigurations" value="{t}Edit package configurations{/t}">
+{/if}
         </td>
        </tr>
 {/render}