PHP: ldap_delete - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ldap_dn2ufn ldap_count_entries

Last updated: Fri, 26 Jan 2007

view this page in

# ldap_delete

(PHP 3, PHP 4, PHP 5)

ldap_delete -- Delete an entry from a directory

## Description

bool ldap_delete ( resource link_identifier, string dn )

Возвращает `TRUE` в случае успешного завершения или `FALSE` в случае возникновения ошибки.

ldap_delete() function delete a particular entry in LDAP directory specified by `dn`.

add a note User Contributed Notes
ldap_delete
sergiopaternoster at tiscali dot it
11-Apr-2003 11:02
`If you receive a "Strong(er) authentication required" error message when you try to delete an entry on OpenLDAP 2.1.6 set LDAP version 3 first:
$ds = ldap_connect($my_ldap_host);
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
$r=@ldap_bind($ds,$bind_dn,$bind_pwd);
Enjoy LDAP
Sergio`
gabriel at hrz dot uni-marburg dot de
14-May-2002 08:16
`Useful function to delete dn entries recursively
bool myldap_delete ( resource ds, string dn, bool recursive)
Returns TRUE on success, FALSE on failure
recursive is by default FALSE (same behaviour as ldap_delete)
function myldap_delete($ds,$dn,$recursive=false){
if($recursive == false){
return(ldap_delete($ds,$dn));
}else{
//searching for sub entries
$sr=ldap_list($ds,$dn,"ObjectClass=*",array(""));
$info = ldap_get_entries($ds, $sr);
for($i=0;$i<$info['count'];$i++){
//deleting recursively sub entries
$result=myldap_delete($ds,$info[$i]['dn'],$recursive);
if(!$result){
//return result code, if delete fails
return($result);
}
}
return(ldap_delete($ds,$dn));
}
}`
add a note
ldap_dn2ufn ldap_count_entries

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST