From b2c7aa9490de8f467b0b5fe14ebc835dbdcc476b Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 10 May 2006 08:57:53 +0000 Subject: [PATCH] Fixed removing, too git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3260 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_plugin.inc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 52a2a0379..c769b8fc3 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -935,18 +935,22 @@ class plugin echo "DEBUG: $dn is not tagged
"; return; } - echo "DEBUG: Remove tagging from $dn.
"; - $nattrs= array("gosaUnitTag" => array()); - $nattrs['objectClass']= array(); - for ($i= 0; $i<$attrs['objectClass']['count']; $i++){ - $oc= $attrs['objectClass'][$i]; - if ($oc != "gosaAdministrativeUnitTag"){ - $nattrs['objectClass'][]= $oc; + if (count($attrs)){ + echo "DEBUG: Remove tagging from $dn.
"; + $nattrs= array("gosaUnitTag" => array()); + $nattrs['objectClass']= array(); + for ($i= 0; $i<$attrs['objectClass']['count']; $i++){ + $oc= $attrs['objectClass'][$i]; + if ($oc != "gosaAdministrativeUnitTag"){ + $nattrs['objectClass'][]= $oc; + } } + $ldap->cd($dn); + $ldap->modify($nattrs); + show_ldap_error($ldap->get_error()); + } else { + echo "DEBUG: not removing tag ($tag) $dn - seems to have moved away
"; } - $ldap->cd($dn); - $ldap->modify($nattrs); - show_ldap_error($ldap->get_error()); } } -- 2.30.2