ID: 14693 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Old Status: Closed Status: Open Bug Type: LDAP related Operating System: Sun Solaris 2.7 (32 bit) PHP Version: 4.1.0 New Comment:
Thanks for fast answer, right now it works. Why I think it is bug, simply I write code you saw in bug report, but I also test with dc=srce,dc=hr (few more) and it worked fine, I only got warnings when I put dc=hr . I use OpenLdap 2.0.19, and v2 and v3 protocol, with referrals, ds.carnet.hr is national LDAP server with base DN dc=hr. So in one moment LDAP function use v3 and on onther v2 protocol, that is very confused. Right away I check my configuration, and I think maybe is misfunctionality (bug) :) ... whay I think so 1. My server a able to answer on v2 and v3 standard, in that case at least I will expect to got 0 for answer 2. Ldap Browser 2.8.2 by Jarek Gawor (jar) return "No entries mached" for same search using v2 protocol. My I sugest to implement that feature in some of next realeas of LDAP functions for PHP. Previous Comments: ------------------------------------------------------------------------ [2001-12-25 17:35:36] [EMAIL PROTECTED] The problem has to do with continuation reference and which LDAP version you use. Most LDAP libs default to v2. Please try the following script (worked for me): $ds=ldap_connect("ds.carnet.hr"); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ds, LDAP_OPT_REFERRALS, 1); $r=ldap_bind($ds); $dn = 'dc=hr'; $filter="(o=*)"; $justthese = array( "dc"); $sr=ldap_search($ds, $dn, $filter, $justthese); $info = ldap_get_entries($ds, $sr); ldap_close($ds); var_dump($info); I've told it to use v3, and also to follow referrals. You can probably omit the referrals setting, I think that's the default, but depends on library. I also suggest you try: $ds=ldap_connect("ds.carnet.hr"); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ds, LDAP_OPT_REFERRALS, 0); $r=ldap_bind($ds); $dn = 'dc=hr'; $filter="(objectclass=*)"; $justthese = array( "dc"); $sr=ldap_search($ds, $dn, $filter, $justthese); $info = ldap_get_entries($ds, $sr); ldap_close($ds); var_dump($info); I'm closing this since I don't think there's a problem. Reopen if you disagree. ------------------------------------------------------------------------ [2001-12-25 17:08:01] [EMAIL PROTECTED] <script LANGUAGE="PHP"> $ds=ldap_connect("ds.carnet.hr"); $r=ldap_bind($ds); $dn = 'dc=hr'; $filter="(o=*)"; $justthese = array( "dc"); $sr=ldap_search($ds, $dn, $filter, $justthese); $info = ldap_get_entries($ds, $sr); print $info["count"]." entries returned<p>"; ldap_close($ds); </script> Warning: LDAP: Unable to perform the search: No such object in /web/www/htdocs/ltest/bug.php on line 11 Warning: Supplied argument is not a valid ldap result resource in /web/www/htdocs/ltest/bug.php on line 13 entries returned - When puting $dn equal anything else then single signed base name (dc=<something>), script work without warning. ./configure --with-mysql --with-gd --with-ldap=/home/ldap/ldap --with-config-file-path=/usr/local/apache --prefix=/usr/local/apache --enable-ftp --with-ftp --enable-track-vars --with-apache=/opt/apache_1.3.22 --with-curl=/usr/local ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=14693&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]