Bug #2809: ldap_get_entries returns no values when only retrieving DN

From: Date: Tue, 23 Nov 1999 22:21:51 +0000
Subject: Bug #2809: ldap_get_entries returns no values when only retrieving DN
Groups: php.dev 
Request: Send a blank email to php-dev+get-13020@lists.php.net to get a copy of this message
From: robert.everett@wcom.com Operating system: Solaris 2.6 PHP version: 3.0.12 PHP Bug Type: LDAP related Bug description: ldap_get_entries returns no values when only retrieving DN 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);

« previous php.dev (#13020) next »