note 20961 deleted from ref.ldap by cmb
| From: | cmb@php.net | Date: | Sun, 17 Nov 2019 08:36:03 +0000 |
| Subject: | note 20961 deleted from ref.ldap by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213078@lists.php.net to get a copy of this message | ||
Note Submitter: php ^ pixelcop , com
----
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>";