Code

Added printer patch
[gosa.git] / plugins / admin / applications / class_applicationParameters.inc
index 3cbf0118fad19dd95eda5ff58240a7115790d77a..426bbf190dbc186b959cff38298291b332907d54 100644 (file)
@@ -90,18 +90,27 @@ class applicationParameters extends plugin
                $this->option_name[]= "";
                $this->option_value[]= "";
        }
+
+       $mode= "";
+       if (chkacl($this->acl, "create") != ""){
+               $mode= "disabled";
+       }
+
        $table= "<table summary=\"\"><tr><td>"._("Variable")."</td><td>"._("Default value")."</td><td></td></tr>";
        if (count ($this->option_name)){
                for ($i= 0; $i < count($this->option_name); $i++){
                        $table.="<tr><td><input name=\"option$i\" size=25 maxlength=50 ".
-                               "value=\"".$this->option_name[$i]."\"></td><td><input name=\"value$i\" ".
-                               "size=60 maxlength=250 value=\"".$this->option_value[$i]."\"><br></td><td>".
+                               "value=\"".$this->option_name[$i]."\" $mode></td><td><input name=\"value$i\" ".
+                               "size=60 maxlength=250 value=\"".$this->option_value[$i]."\" $mode><br></td><td>".
                                "<input type=\"submit\" name=\"remove$i\" value=\"".
-                               _("Remove")."\"></td></tr>";
+                               _("Remove")."\" $mode></td></tr>";
                }
        }
        $table.= "</table>";
-       $table.="<input type=\"submit\" name=\"add_option\" value=\""._("Add option")."\">";
+
+       if ($mode == ""){
+               $table.="<input type=\"submit\" name=\"add_option\" value=\""._("Add option")."\">";
+       }
 
        /* Show main page */
        $smarty= get_smarty();
@@ -123,9 +132,9 @@ class applicationParameters extends plugin
         @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
                 $this->attributes, "Save");
        $this->cleanup();
-$ldap->modify ($this->attrs); 
+       $ldap->modify ($this->attrs); 
 
-       show_ldap_error($ldap->get_error());
+       show_ldap_error($ldap->get_error(), _("Removing application parameters failed"));
 
        /* Optionally execute a command after we're done */
        $this->handle_post_events('remove');
@@ -150,7 +159,8 @@ $ldap->modify ($this->attrs);
   /* Check values */
   function check()
   {
-       $message= array();
+       /* Call common method to give check the hook */
+       $message= plugin::check();
 
        /* Check for valid option names */
        for ($i= 0; $i<count($this->option_name); $i++){
@@ -184,9 +194,9 @@ $ldap->modify ($this->attrs);
         @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
                 $this->attributes, "Save");
        $this->cleanup();
-$ldap->modify ($this->attrs); 
+       $ldap->modify ($this->attrs); 
 
-       show_ldap_error($ldap->get_error());
+       show_ldap_error($ldap->get_error(), _("Saving applications parameters failed"));
 
        /* Optionally execute a command after we're done */
        $this->handle_post_events('modify');