Code

* Saved missing value for goImapSieveServer
[gosa.git] / plugins / admin / systems / class_workstationStartup.inc
index 7be89caf05ca6888c4abbfe3de55f4489797e581..c5ca3cced69af4ac1b745a1d9c8278a580342e18 100644 (file)
@@ -109,7 +109,7 @@ class workstartup extends plugin
 
     /* Search all FAI objects */
     $ldap->search("(| (objectClass=FAIpackageList)(objectClass=FAItemplate)
-                      (objectClass=FAIvariable)(objectClass=FAIscript')(objectClass=FAIhook)(objectClass=FAIprofile)
+                      (objectClass=FAIvariable)(objectClass=FAIscript)(objectClass=FAIhook)(objectClass=FAIprofile)
                       (objectClass=FAIpartitionTable))",array("objectClass","cn"),true);
     /* Sort all entries, and attach elementtype.
      * To be able to show the types in the listbox.
@@ -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;
   }
 
@@ -201,6 +201,9 @@ class workstartup extends plugin
 
   function execute()
   {
+       /* Call parent execute */
+       plugin::execute();
+
     /* Do we need to flip is_account state? */
     if (isset($_POST['modify_state'])){
       $this->is_account= !$this->is_account;
@@ -244,8 +247,8 @@ class workstartup extends plugin
         }
       }
 
-      if((isset($this->FAIclassInfo[$_POST['FAIclassesSel']]['FAIpackageList']))&&($found>0)){
-        print_red(_("There is already a profile in your selection that contain partition table configuratons."));
+      if((isset($this->FAIclassInfo[$_POST['FAIclassesSel']]['FAIpartitionTable']))&&($found>0)){
+        print_red(_("There is already a profile in your selection that contain partition table configurations."));
       }else{
         $this->FAIclass[$_POST['FAIclassesSel']]=$_POST['FAIclassesSel'];
       }
@@ -462,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){
@@ -484,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 = "";