The next article is basically what you need to do. You have to make
sure you discover any children then node might have before you delete
it. You need a recursive algorithm to do this.
Aur�lien Labrosse wrote:
> Hi,
> so there's my code snippet :
>
> $element = $entry->FIRSTKEY();
> while($element)
> {
> $entry->remove($element);
> $element = $entry->NEXTKEY();
> }
> $conn_ldap->delete( $entry->getDN() );
>
> if($conn_ldap->getErrorString() eq "Success")
> {
> &utils::log($IDClient . $loggingTab[$logCode] . " OK ") if $DEBUG>0;
> }
> else
> {
> &utils::log($IDClient . $loggingTab[$logCode] .
> $conn_ldap->getErrorString() . " FAIL");
> }
>
> but i get the "non leaf" error if a search return more than one "dn", on the
> last one.
> I check the "remove" errorString in the loop, ans its always success. the
> snippet treat all the elements
> i could see by a standard "ldapsearch" shell command. So why its not
> considered as a leaf?
>
> Aur�lien
>
> Kevin L. Burns <[EMAIL PROTECTED]> a �crit dans le message :
> [EMAIL PROTECTED]
>
>>More specifically, it isn't the attributes you have to discover and
>>delete, it is the node's children.
>>
>>Jonathan McClure wrote:
>>
>>>You can't delete the non leaf entries automatically. You have to delete
>>>
> the
>
>>>subentries recursively. Similar to trying to delete an empty DOS dir.
>>>
>>>-----Original Message-----
>>>From: Aur�lien Labrosse [mailto:[EMAIL PROTECTED]]
>>>Sent: Wednesday, September 05, 2001 12:49 PM
>>>To: [EMAIL PROTECTED]
>>>Subject: $conn->delete($entry->getDN());
>>>
>>>
>>>Hi,
>>>when i try to delete an entry, i always get in errorString :
>>>"operation non allowed on non leaf"
>>>What should i do before? discover all attributes and delete them one by
>>>
> one?
>
>>>thx...
>>>
>>>Aur�lien
>>>
>>>
>>>
>>>
>>>
>
>