From: hickert Date: Thu, 16 Sep 2010 08:04:38 +0000 (+0000) Subject: 'Updated save method for class device X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e3c47135c471af5cfb7fb7013eaedd1d3bbb1d62;p=gosa.git 'Updated save method for class device git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19693 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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{