Changeset View
Changeset View
Standalone View
Standalone View
lib/Net/LDAP3.php
Show First 20 Lines • Show All 659 Lines • ▼ Show 20 Lines | class Net_LDAP3 | ||||
} | } | ||||
/** | /** | ||||
* Deletes specified entry and all entries in the tree | * Deletes specified entry and all entries in the tree | ||||
*/ | */ | ||||
public function delete_entry_recursive($entry_dn) | public function delete_entry_recursive($entry_dn) | ||||
{ | { | ||||
// searching for sub entries, but not scope sub, just one level | // searching for sub entries, but not scope sub, just one level | ||||
$result = $this->search($entry_dn, '(objectclass=*)', 'one'); | $result = $this->search($entry_dn, '(|(objectclass=*)(objectclass=ldapsubentry))', 'one'); | ||||
if ($result) { | if ($result) { | ||||
$entries = $result->entries(true); | $entries = $result->entries(true); | ||||
foreach (array_keys($entries) as $sub_dn) { | foreach (array_keys($entries) as $sub_dn) { | ||||
if (!$this->delete_entry_recursive($sub_dn)) { | if (!$this->delete_entry_recursive($sub_dn)) { | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,454 Lines • Show Last 20 Lines |