note 110732 rejected from function.ldap-read by aharvey
| From: | aharvey@php.net | Date: | Thu, 29 Nov 2012 08:25:39 +0000 |
| Subject: | note 110732 rejected from function.ldap-read by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192188@lists.php.net to get a copy of this message | ||
Note Submitter: nicubalti at gmail dot com
----
Hello
I have the following code:
$ldapconn = ldap_connect("mycompany.com")
or die("Could not connect to LDAP server.");
if ($ldapconn) {
// binding anonymously
$ldapbind = ldap_bind($ldapconn);
$ds = "OU=DEV,OU=Users,OU=CHI,OU=mycompany,DC=mycompany,DC=com";
$filter="(objectclass=*)";
$sr = ldap_read($ldapconn, $ds, $filter);
$info = ldap_get_entries($ldapconn, $sr);
if ($ldapbind) {
echo "LDAP bind anonymous successful...";
} else {
echo "LDAP bind anonymous failed...";
}
}
This code gives me the follwing error:
Warning: ldap_read() [<a href='function.ldap-read'>function.ldap-read</a>]:
Search: Operations error in D:\SymfonyProject\myreport\web\app_dev.php on line 36
Line 36 is
$sr = ldap_read($ldapconn, $ds, $filter);
if I set the
$ds = "";
then the error disappear but in $info there are no data from ldap. In $info are only same generale
information like currenttime, subschemasubentry, dsservicename, supportedcontrol etc.
The message LDAP bind anonymous successful.. is shown