php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34308 function ldap_parse_reference
Submitted: 2005-08-30 14:44 UTC Modified: 2005-08-30 17:04 UTC
From: niltonneto at celepar dot pr dot gov dot br Assigned:
Status: Not a bug Package: LDAP related
PHP Version: 4.4.0 OS: Linux Debian
Private report: No CVE-ID: None
 [2005-08-30 14:44 UTC] 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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-30 16:23 UTC] sniper@php.net
Why should it work if you disable the feature with:

ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);

 [2005-08-30 17:04 UTC] niltonneto at celepar dot pr dot gov dot br
It could be correct!!! I concord with you!!
But,
In PHP 4.3.10 it works just with:
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0)
If I enable this feature, the referral array returns empty.

And the PHP4.4, 
If I enable this feature, the referral array returns empty.
or If I disable, it not works !!! Some error happens and it not display (and no log)

If possible, could you make a test, please?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 14:01:31 2024 UTC