Code

Added FAIprofile selection for Workstations
[gosa.git] / plugins / admin / fai / class_faiScriptEntry.inc
index 903230055977e3de746c576b549f0be8bc5e72ca..1fb0239d9088aa3a47b1b1d011c65f719399a986 100644 (file)
@@ -50,18 +50,21 @@ class faiScriptEntry extends plugin
       if(($_FILES['ImportFile']['size']==0)){
         print_red(_("Selected file is empty."));
       }else{
-        $str = file_get_contents($_FILES['ImportFile']['tmp_name']);
+        $str = utf8_encode(file_get_contents($_FILES['ImportFile']['tmp_name']));
         $this->Object_FAIscript = $str;
       }
     }
 
   
-
     foreach($this->attributes as $attrs){
-      $smarty->assign($attrs,stripslashes($this->$attrs));
+      if(get_magic_quotes_gpc()){
+       $smarty->assign($attrs,stripslashes($this->$attrs));
+      }else{
+       $smarty->assign($attrs,($this->$attrs));
+      } 
     }
 
-    for($i =1 ; $i <= 100 ; $i++){
+    for($i =0 ; $i < 100 ; $i++){
       $Object_FAIprioritys[$i]=$i;
     }
     $smarty->assign("Object_FAIprioritys",$Object_FAIprioritys);
@@ -88,20 +91,6 @@ class faiScriptEntry extends plugin
   {
     $message= array();
   
-    $str = utf8_encode("üöä");
-
-    if(empty($this->Object_FAIscript)){
-      $message[]=_("Please specify a script.");
-    }
-    
-    if(empty($this->Object_description)){
-      $message[] = _("Please enter a description.");
-    }
-
-    if(preg_match("/[^a-z0-9".$str."\.,;:\-_\? ]/i",$this->Object_description)){
-      $message[] = _("Invalid character in description. Please enter a valid description.");
-    }
-
     if(empty($this->Object_cn)){
       $message[] = _("Please enter a name.");
     }