From 7ee46910e71e368b3cb8e1f4fcdecb6ce85e5dbd Mon Sep 17 00:00:00 2001 From: cajus Date: Mon, 20 Jun 2005 10:45:37 +0000 Subject: [PATCH] Fixed objectclass saving in server tabs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@758 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_servDB.inc | 2 -- plugins/admin/systems/class_servService.inc | 22 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/plugins/admin/systems/class_servDB.inc b/plugins/admin/systems/class_servDB.inc index 260097ab2..316089bd9 100644 --- a/plugins/admin/systems/class_servDB.inc +++ b/plugins/admin/systems/class_servDB.inc @@ -216,8 +216,6 @@ class servdb extends plugin } $this->attrs = array_reverse($this->attrs); - - /* Write to LDAP */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); diff --git a/plugins/admin/systems/class_servService.inc b/plugins/admin/systems/class_servService.inc index 444df8cf0..9189fad0d 100644 --- a/plugins/admin/systems/class_servService.inc +++ b/plugins/admin/systems/class_servService.inc @@ -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"), @@ -187,8 +189,24 @@ class servservice extends plugin plugin::save(); - /* Normalize objectclasses */ - $this->attrs['objectClass']= $this->objectclasses; + $tmp= array(); + + /* Remove all from this plugin */ + foreach($this->attrs['objectClass'] as $oc){ + if (!in_array_ics($oc, $this->possible_objectclasses)){ + $tmp[]= $oc; + } + } + + /* Merge our current objectclasses */ + foreach($this->objectclasses as $oc){ + if (!in_array_ics($oc, $tmp)){ + $tmp[]= $oc; + } + } + + /* Reassign cleaned value */ + $this->attrs['objectClass']= $tmp; /* Remove illegal attributes */ foreach ($this->additionaloc as $oc => $attrs){ -- 2.30.2