Code

Fixed problem with not clickable buttons in fai package error msgs
[gosa.git] / plugins / admin / fai / class_faiScriptEntry.inc
index 2a56bcb0d92afd6a73c4ef4220f2c1d1487b3f5a..4f5cf2990f647fff755bbdeee24b3c1f3a999d13 100644 (file)
@@ -20,7 +20,7 @@ class faiScriptEntry extends plugin
   var $FAIscript     = "";
   var $description   = "";
   var $status        = "new";
-
+  var $parent        = NULL;
   var $FAIstate      = "";
   
   function faiScriptEntry ($config, $dn= NULL,$object=false)
@@ -84,7 +84,7 @@ class faiScriptEntry extends plugin
     }
 
      /* Create download button*/
-    if($this->dn != "new"){
+    if($this->dn != "new" && $this->acl_is_readable("FAIscript")){
       $smarty->assign("DownMe","<a href='getFAIscript.php?id=".base64_encode($this->dn)."'>
         <input type='button' value='"._("Download")."'>
         </a>");
@@ -132,6 +132,10 @@ class faiScriptEntry extends plugin
     /* Call common method to give check the hook */
     $message= plugin::check();
   
+    if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){
+      $message[] =_("There is already a script with the given name.");
+    }
+
     if(empty($this->cn)){
       $message[] = _("Please enter a name.");
     }