note 73488 added to function.ldap-get-dn
| From: | langhammer at gmail dot com | Date: | Sun, 25 Feb 2007 21:29:17 +0000 |
| Subject: | note 73488 added to function.ldap-get-dn | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123860@lists.php.net to get a copy of this message | ||
Hi guys,
I use LDAP to find different contexts in a few communitys.
So my example has also a limited search.
If there is any error mail me.
<?php
// specify your LDAP-Server
$ldapserver=172.16.250.40;
// specify username`s-dn you would like to find
$username="steffen_langhammer";
// specify ldap_tree if you wouldn't search every unit
// Here an fictive example to find usersdn in: "Cologne,Germany,General Motors"
$ldaptree="ou=CO,ou=DE,o=GM";
// Connect to ldap, optional you should bind
$ldapconnector=@ldap_connect($ldapserver);
// The example:
$ldapusersearch=@ldap_search($ldapconnector,$ldaptree,cn=$username);
$entryid=@ldap_first_entry($ldapconnector, $ldapusersearch);
$ldapdnread=@ldap_get_dn($ldapconnector,$entryid);
// Output result
echo"Users DN is: ".$ldapdnread;
?>
Steffen
----
Server IP: 212.124.37.9
Probable Submitter: 85.181.242.214
----
Manual Page -- http://www.php.net/manual/en/function.ldap-get-dn.php
Edit -- https://master.php.net/note/edit/73488
Del: integrated -- https://master.php.net/note/delete/73488/integrated
Del: useless -- https://master.php.net/note/delete/73488/useless
Del: bad code -- https://master.php.net/note/delete/73488/bad+code
Del: spam -- https://master.php.net/note/delete/73488/spam
Del: non-english -- https://master.php.net/note/delete/73488/non-english
Del: in docs -- https://master.php.net/note/delete/73488/in+docs
Del: other reasons-- https://master.php.net/note/delete/73488
Reject -- https://master.php.net/note/reject/73488
Search -- https://master.php.net/manage/user-notes.php