Code

FAIclasses for WS are saved in one string
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 17 Nov 2005 09:05:52 +0000 (09:05 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 17 Nov 2005 09:05:52 +0000 (09:05 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1958 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_workstationStartup.inc

index 6e544c855e2c575b2d9611e6c12ce6e4cc8f628b..fb0970de171ecf6ed196515b4d81b8a1a47a26c5 100644 (file)
@@ -155,21 +155,21 @@ class workstartup extends plugin
 
     $this->FAIclassInfo = $tmp2;
 
-    if(isset($this->attrs['FAIclass'])){
+    if((isset($this->FAIclass))&&(!is_array($this->FAIclass))){
       $tmp = array();
-      $tmp2 = $this->attrs['FAIclass'];
-      unset($tmp2['count']);
-      foreach($tmp2 as $class){
-        $tmp[$class] = $class;
+      $tmp = split(" ",$this->FAIclass);
+      $tmp2 =array();  
+    
+      foreach($tmp as $class){
+        $tmp2[$class] = $class;
       }
-      $this->FAIclass = $tmp;
+      $this->FAIclass = $tmp2;
     }
 
     if(!is_array($this->FAIclass)){
-      $this->FAIclass = array();
+      $this->FAIclass =array();
     }
 
-
     $this->orig_dn= $this->dn;
   }
 
@@ -465,14 +465,18 @@ class workstartup extends plugin
       $this->gotoKernelParameters.= " o ".$this->customParameters;
     }
 
-    /* Create numeric index for our classes */
-    $tmp = array();
+    plugin::save();
+    
+    $str = "";
     foreach($this->FAIclass as $class){
-      $tmp[] = $class;
+      $str .= $class." ";
     }
-    $this->FAIclass = $tmp;
+    $this->attrs['FAIclass']= "";
+    $this->attrs['FAIclass']= trim($str);
 
-    plugin::save();
+    if(empty($this->attrs['FAIclass'])){
+      $this->attrs['FAIclass'] = array();
+    }
 
     /* Add missing arrays */
     foreach (array("gotoFilesystem", "gotoAutoFs", "gotoModules") as $val){
@@ -487,13 +491,6 @@ class workstartup extends plugin
       unset ($this->attrs['gotoLdapServer']);
     }
 
-    $tmp = array();
-    foreach($this->FAIclass as $class){
-      $tmp[] = $class;
-    }
-    $this->attrs['FAIclass'] = $tmp;
-    /* Write back to ldap */
-
     /* if mirror == none stop saving this attribute */
     if($this->FAIdebianMirror == "none"){
       $this->FAIdebianMirror = "";