Code

services -> one litle fix needed
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 13 May 2005 12:35:24 +0000 (12:35 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 13 May 2005 12:35:24 +0000 (12:35 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@208 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servDB.inc
plugins/admin/systems/class_servService.inc

index dfa0f784fbbb2260a9edd3577c684bfe814bebe0..7518cdcf60d047f3f9aa99c09fd1c3531068e0c4 100644 (file)
@@ -168,7 +168,13 @@ class servdb extends plugin
     plugin::save();
     
     /* Remove objectclasses */
-    unset ($this->attrs['objectClass']);
+    foreach(array_merge($this->objectclasses, $this->additionaloc) as $oc){
+      foreach ($this->attrs['objectClass'] as $key => $value){
+        if ($value == $oc){
+          unset ($this->attrs['objectClass'][$key]);
+        }
+      }
+    }
     foreach($this->objectclasses as $oc){
       $this->attrs['objectClass'][]= $oc;
     }
index df8f12ec6a35e9c0234bfe015e910d5f862a1ce3..6cace375b388c0cb07d80cf4c2bfc94bef5ffedb 100644 (file)
@@ -21,7 +21,7 @@ class servservice extends plugin
 
 
   /* attribute list for save action */
-  var $attributes       = array("goExportEntry","goTimeSource","goLdapBase","goXdmcpIsEnabled","goFontPath");
+  var $attributes       = array("goExportEntry","goTimeSource","goLdapBase","goXdmcpIsEnabled","goFontPath" );
   var $objectclasses    = array("top","goServer"); 
   var $additionaloc     = array(
                 
@@ -29,8 +29,8 @@ class servservice extends plugin
                           "goNtpServer"     => array("goTimeSource"),
                           "goLdapServer"    => array("goLdapBase"),
                           "goTerminalServer"=> array("goXdmcpIsEnabled", "goFontPath"),
-                          "goSyslogServer"  => array(""),
-                          "goCupsServer"    => array("")                           
+                          "goSyslogServer"  => array(),
+                          "goCupsServer"    => array()                           
                           );
 
 
@@ -45,8 +45,6 @@ class servservice extends plugin
   {
     plugin::plugin ($config, $dn);
 
-    /* Always is account... */
-
     foreach ($this->additionaloc as $oc => $dummy){
       if (isset($this->attrs['objectClass']) && in_array($oc, $this->attrs['objectClass'])){
         $this->objectclasses[$oc]= $oc;
@@ -201,11 +199,19 @@ class servservice extends plugin
     plugin::save();
 
     /* Remove objectclasses */
-    unset ($this->attrs['objectClass']);
+    foreach(array_merge($this->objectclasses, $this->additionaloc) as $oc){
+      foreach ($this->attrs['objectClass'] as $key => $value){
+        if ($value == $oc){
+          unset ($this->attrs['objectClass'][$key]);
+        }
+      }
+    }
+    $this->attrs['objectClass']=array();
     foreach($this->objectclasses as $oc){
       $this->attrs['objectClass'][]= $oc;
     }
 
+
     /* Adapt sieve server if needed */
     if (in_array('goImapServer', $this->objectclasses)){
       $this->attrs['goImapSieveServer']= preg_replace('/:.*$/', '',
@@ -221,7 +227,9 @@ class servservice extends plugin
         }
       }
     }
-
+      
+    print_a($this->attrs);
+    
     /* Write to LDAP */
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->dn);