Code

goFonQueueStrategy will be saved in correct format now
[gosa.git] / plugins / admin / systems / class_servService.inc
index 444df8cf0ae3410562407ef4ab59a24a81847c20..176316384f03c099ec88fbfbfcfb2b632a031b7e 100644 (file)
@@ -21,6 +21,8 @@ class servservice extends plugin
   /* attribute list for save action */
   var $ignore_account= TRUE;
   var $attributes       = array("goLdapBase","goXdmcpIsEnabled","goFontPath");
+  var $possible_objectclasses= array( "goNfsServer", "goNtpServer", "goServer", "goLdapServer",
+                                      "goTerminalServer", "goSyslogServer", "goCupsServer");
   var $objectclasses    = array("top","goServer"); 
   var $additionaloc     = array( "goNfsServer"     => array("goExportEntry"),
                                  "goNtpServer"     => array("goTimeSource"),
@@ -170,6 +172,10 @@ class servservice extends plugin
   function check()
   {
     $message= array();
+  
+    if((isset($_POST['goTerminalServer']))&&(empty($this->goFontPath))){
+      $message[]=_("Terminal server, must have fontpath specified.");
+    }
 
     return ($message);
   }
@@ -178,17 +184,26 @@ class servservice extends plugin
   /* Save to LDAP */
   function save()
   {
-    /* Normalize lazy objectclass arrays */
-    $objectclasses= array();
-    foreach($this->objectclasses as $oc){
-      $objectclasses[]= $oc;
+    plugin::save();
+
+    $tmp= array();
+
+    /* Remove all from this plugin */
+    foreach($this->attrs['objectClass'] as $oc){
+      if (!in_array_ics($oc, $this->possible_objectclasses)){
+        $tmp[]= $oc;
+      }
     }
-    $this->objectclasses= $objectclasses;
 
-    plugin::save();
+    /* Merge our current objectclasses */
+    foreach($this->objectclasses as $oc){
+      if (!in_array_ics($oc, $tmp)){
+        $tmp[]= $oc;
+      }
+    }
 
-    /* Normalize objectclasses */
-    $this->attrs['objectClass']= $this->objectclasses;
+    /* Reassign cleaned value */
+    $this->attrs['objectClass']= $tmp;
 
     /* Remove illegal attributes */
     foreach ($this->additionaloc as $oc => $attrs){