From: cajus Date: Wed, 10 May 2006 08:57:53 +0000 (+0000) Subject: Fixed removing, too X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b2c7aa9490de8f467b0b5fe14ebc835dbdcc476b;p=gosa.git Fixed removing, too git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3260 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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()); } }