From e3c47135c471af5cfb7fb7013eaedd1d3bbb1d62 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 16 Sep 2010 08:04:38 +0000 Subject: [PATCH] 'Updated save method for class device git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19693 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/devices/class_registeredDevice.inc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gosa-plugins/goto/admin/systems/goto/devices/class_registeredDevice.inc b/gosa-plugins/goto/admin/systems/goto/devices/class_registeredDevice.inc index 2a7764ee6..c295d888e 100644 --- a/gosa-plugins/goto/admin/systems/goto/devices/class_registeredDevice.inc +++ b/gosa-plugins/goto/admin/systems/goto/devices/class_registeredDevice.inc @@ -50,12 +50,25 @@ class registeredDevice extends plugin function save() { + plugin::save(); + + // Append and remove dynmic object classes + foreach($this->dynClasses as $oc => $attrs){ + $this->attrs['objectClass'] = array_remove_entries(array($oc), $this->attrs['objectClass']); + foreach($attrs as $attr){ + if(isset($this->attrs[$attr]) && !empty($this->attrs[$attr])){ + $this->attrs['objectClass'][] = $oc; + break; + } + } + } + $this->cleanup(); $ldap=$this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); $ldap->cd($this->dn); - + if($this->initially_was_account){ $ldap->modify($this->attrs); }else{ -- 2.30.2