Code

Updated FAI Package Variable saving
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Apr 2008 09:05:33 +0000 (09:05 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Apr 2008 09:05:33 +0000 (09:05 +0000)
-Skip saving empty variables of type string. The schema does not allow such entries.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10391 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiPackage.inc

index 5b9f1dee40c73b8aaef4c7b643b484a692042dda..3fb126de055d6228a54852e1ddab868af58c8593 100644 (file)
@@ -518,11 +518,16 @@ class faiPackage extends plugin
         $pkgattrs['FAIvariableContent']   = $attr['Value'];
         $pkgdn =  "FAIvariable=".$name.",".$this->dn;
 
-       /* Tag object */
-       $this->tag_attrs($pkgattrs, $pkgdn, $this->gosaUnitTag);
+        /* Tag object */
+        $this->tag_attrs($pkgattrs, $pkgdn, $this->gosaUnitTag);
 
         if(in_array($pkgattrs['FAIvariableType'],array("boolean","multiselect","password","select","string","text"))){
-          FAI::prepare_to_save_FAI_object($pkgdn,$pkgattrs);
+
+          if($pkgattrs['FAIvariableType'] == "text" && $pkgattrs['FAIvariableContent'] == ""){
+            gosa_log("Skipped saving FAIvariable '$name' empty string can't be saved.");
+          }else{
+            FAI::prepare_to_save_FAI_object($pkgdn,$pkgattrs);
+          }
         }
       }
     }