From 3fe808c869b803beca156831aac4489b107bb100 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 13 Sep 2007 09:26:33 +0000 Subject: [PATCH] Simplified save() routine, replaced foreach with gosa_array_merge git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7287 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_plugin.inc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/include/class_plugin.inc b/include/class_plugin.inc index eb4d40a8f..47dd20c51 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -243,7 +243,7 @@ class plugin /* Get current objectClasses in order to add the required ones */ $ldap->cat($this->dn); $tmp= $ldap->fetch (); - $oc= array(); + $oc= array(); if (isset($tmp['objectClass'])){ $oc= $tmp['objectClass']; unset($oc['count']); @@ -319,22 +319,18 @@ class plugin $ldap->cat($this->dn); $tmp= $ldap->fetch (); - + + $oc= array(); if (isset($tmp['objectClass'])){ $oc= $tmp["objectClass"]; $this->is_new= FALSE; + unset($oc['count']); } else { - $oc= array("count" => 0); $this->is_new= TRUE; } /* Load (minimum) attributes, add missing ones */ - $this->attrs['objectClass']= $this->objectclasses; - for ($i= 0; $i<$oc["count"]; $i++){ - if (!in_array_ics($oc[$i], $this->objectclasses)){ - $this->attrs['objectClass'][]= $oc[$i]; - } - } + $this->attrs['objectClass']= gosa_array_merge($oc,$this->objectclasses); /* Copy standard attributes */ foreach ($this->attributes as $val){ -- 2.30.2