|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-11-28 18:20 UTC] venaas at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 19:00:02 2025 UTC |
PHP 3.0.12 Apache 1.3.9 Netscape LDAP 4.11 Solaris 2.6 ldap_get_entries() returns false when only retrieving DN. It will also fail if requesting attributes whose values are all empty. -- Sometimes OK (CN & DN) -- $ld = ldap_connect("ldap.foobar.com", 389); $base = "o=Foobar,c=US"; $attrs = array("cn"); $filter = "(uid=testuser)"; $sr = ldap_search($ld, $base, $filter, $attrs); $info = ldap_get_entries($ld, $sr); // OK as long as "cn" contains a value; otherwise $info is empty echo $info[0]["dn"]."<br>"; echo $info[0]["cn"][0]."<br>"; ldap_unbind($ld); -- Always Fails (DN only) -- $ld = ldap_connect("ldap.foobar.com", 389); $base = "o=Foobar,c=US"; $attrs = array("dn"); $filter = "(uid=testuser)"; $sr = ldap_search($ld, $base, $filter, $attrs); $info = ldap_get_entries($ld, $sr); // fails; $info is always empty echo $info[0]["dn"]."<br>"; ldap_unbind($ld);