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