Code

Added multiple edit checks to samba
[gosa.git] / gosa-core / plugins / personal / samba / class_sambaAccount.inc
index 3a9cc0c28e1e9147bd0e6724aa395db52baacd7c..3fb309566cd97248d047a5e980a59bdb6fb529f3 100644 (file)
@@ -1230,6 +1230,37 @@ class sambaAccount extends plugin
     }
   }
 
+
+  function multiple_check()
+  {
+    $message = plugin::multiple_check();
+
+    /* Strings */
+    foreach (array( "sambaHomePath" => _("Home directory"),
+          "sambaProfilePath" => _("Profile path")) as $key => $val){
+      if (in_array($key,$this->multi_boxes) && !$this->mungedObject->is_samba_path($this->$key)){
+        $message[]= sprintf(_("The value specified as '%s' contains invalid characters!"), $val);
+      }
+    }
+
+    /* Numeric values */
+    foreach (array( "CtxMaxConnectionTime"    => _("Connection"),
+                    "CtxMaxDisconnectionTime" => _("Disconnection"),
+                    "CtxMaxIdleTime"          => _("IDLE")) as $key => $val){
+      if (in_array($key,$this->multi_boxes) && 
+          isset($this->mungedObject->ctx[$key]) && 
+          !is_id($this->mungedObject->ctx[$key]) && $val != 0){
+        $message[]= sprintf(_("The timeout property '%s' is checked and contains invalid or no characters!"), $val);
+      }
+    }
+
+    /* Too many workstations? Windows usrmgr only supports eight */
+    if (substr_count($this->sambaUserWorkstations, ",") >= 8){
+      $message[]= _("The windows user manager only allows eight clients. You've specified more than eight.");
+    }
+    return($message);
+  }
+
   
   function get_multi_init_values()
   {