#27794 [Opn]: LDAP extensions not working correctly
| From: | robert_thompson at ml dot com | Date: | Wed, 31 Mar 2004 11:28:55 +0000 |
| Subject: | #27794 [Opn]: LDAP extensions not working correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-57205@lists.php.net to get a copy of this message | ||
ID: 27794
User updated by: robert_thompson at ml dot com
Reported By: robert_thompson at ml dot com
Status: Open
Bug Type: Unknown/Other Function
Operating System: Win2000
PHP Version: 4.3.5
New Comment:
I fought this for days only to figure out that it is because someone in
our company set LDAP so that you can not query without binding with
supplied credentials. Anonymous binding would not work for reporting -
yet you could bind successfully anonymously - wierd.
Previous Comments:
------------------------------------------------------------------------
[2004-03-31 05:42:58] robert_thompson at ml dot com
Description:
------------
I have tried for two days every possibility to get a simple LDAP query
to return anything. I have copied and tried some 50 different scripts.
I can't get anything to come back.
Reproduce code:
---------------
$ldaphost="myserver";
$ldapport=389;
$ldapconn=ldap_connect($ldaphost, $ldapport);
$bind=ldap_bind($ldapconn);
echo "Bind result is ".$r." -- blank is good<p>";
$dn="OU=Support,dc=win,dc=com";
$filter="(|(sn=a*)(givenname=a*))";
$justthese = array( "ou", "sn", "givenname", "mail");
$result=ldap_search($ldapconn, $dn, $filter, $justthese);
echo ldap_error($result);
Expected result:
----------------
Anything
Actual result:
--------------
I get nothing back.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27794&edit=1