From 4a8c7b1c3c3e3a554f798c459ff5fe55e9164cab Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 13 May 2005 12:35:24 +0000 Subject: [PATCH] services -> one litle fix needed git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@208 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_servDB.inc | 8 +++++++- plugins/admin/systems/class_servService.inc | 22 ++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/plugins/admin/systems/class_servDB.inc b/plugins/admin/systems/class_servDB.inc index dfa0f784f..7518cdcf6 100644 --- a/plugins/admin/systems/class_servDB.inc +++ b/plugins/admin/systems/class_servDB.inc @@ -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; } diff --git a/plugins/admin/systems/class_servService.inc b/plugins/admin/systems/class_servService.inc index df8f12ec6..6cace375b 100644 --- a/plugins/admin/systems/class_servService.inc +++ b/plugins/admin/systems/class_servService.inc @@ -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); -- 2.30.2