ID:               34308
 Updated by:       [EMAIL PROTECTED]
 Reported By:      niltonneto at celepar dot pr dot gov dot br
-Status:           Open
+Status:           Bogus
 Bug Type:         LDAP related
 Operating System: Linux Debian
 PHP Version:      4.4.0
 New Comment:

Why should it work if you disable the feature with:

ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);



Previous Comments:
------------------------------------------------------------------------

[2005-08-30 14:44:50] niltonneto at celepar dot pr dot gov dot br

Description:
------------
I had installed PHP 4.3.10.
When I upgraded for PHP 4.4, the function ldap_parse_reference not
worked. The third parameter (array &referral) not works. 

Reproduce code:
---------------
function get_ldap_referrals($ds, $dn, $filter) {                        
                    ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
                    ldap_set_option($ds,LDAP_OPT_PROTOCOL_VERSION,3);
                        
                    if ($ds) {
                       ldap_bind($ds);
                        $sr=ldap_list($ds,$dn, $filter);                    
                        $ref = ldap_first_reference($ds, $sr);
                        $array_referral = array();
                        $referrals =  array();
                        $idx = 0;
                        while ($ref) {                  
                              if (ldap_parse_reference($ds, $ref,&$referrals))  
    {
                                 while ($referral = array_shift($referrals))    
                                        $array_referral[$idx++] = $referral ;   
                
                              }
                              $ref = ldap_next_reference($ds, $ref);
                        }
                        return $array_referral;
                     }
                     else 
                       return false;
}

Expected result:
----------------
My function return all referrals from ldap server.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=34308&edit=1

Reply via email to