note 20961 added to ref.ldap
| From: | php@php.net | Date: | Tue, 23 Apr 2002 17:33:13 +0000 |
| Subject: | note 20961 added to ref.ldap | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-29726@lists.php.net to get a copy of this message | ||
For those trying to do LDAP authentication with Lotus Domino NAB, the following has worked for me
(based on the win2k example by webmaster@autourdupc.com) :
$ip = "localhost";
$dn="CN=Joe Blo, O=myOrganization";
$password = "password";
if (!($ldap = ldap_connect($ip))) {
die ("Could not connect to LDAP server");
}
print "connected to <b>$ip</b><br/>";
if (!($res = @ldap_bind($ldap, $dn, $password))) {
die ("Could not bind to $dn");
}
print "user <b>$dn</b> authenticated.<br/>";
$sdn = "O=myOrganization";
$filter = "(objectclass=*)";
print "executing search...<b>DN: $sdn; Filter: $filter</b><br/>";
$sr=ldap_search($ldap, $sdn, $filter);
$info = ldap_get_entries($ldap, $sr);
print $info["count"]." entries returned<hr>";
print "<PRE>";
print_r($info);
print "</PRE>";
--
http://www.php.net/manual/en/ref.ldap.php
http://master.php.net/manage/user-notes.php?action=edit+20961
http://master.php.net/manage/user-notes.php?action=delete+20961
http://master.php.net/manage/user-notes.php?action=reject+20961