note 110732 added to function.ldap-read
| From: | nicubalti at gmail dot com | Date: | Thu, 29 Nov 2012 07:24:23 +0000 |
| Subject: | note 110732 added to function.ldap-read | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-192182@lists.php.net to get a copy of this message | ||
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
----
Server IP: 69.147.83.199
Probable Submitter: 78.97.93.3
----
Manual Page -- http://www.php.net/manual/en/function.ldap-read.php
Edit -- https://master.php.net/note/edit/110732
Del: integrated -- https://master.php.net/note/delete/110732/integrated
Del: useless -- https://master.php.net/note/delete/110732/useless
Del: bad code -- https://master.php.net/note/delete/110732/bad+code
Del: spam -- https://master.php.net/note/delete/110732/spam
Del: non-english -- https://master.php.net/note/delete/110732/non-english
Del: in docs -- https://master.php.net/note/delete/110732/in+docs
Del: other reasons-- https://master.php.net/note/delete/110732
Reject -- https://master.php.net/note/reject/110732
Search -- https://master.php.net/manage/user-notes.php