ID: 34308
User updated by: niltonneto at celepar dot pr dot gov dot br
Reported By: niltonneto at celepar dot pr dot gov dot br
Status: Bogus
Bug Type: LDAP related
Operating System: Linux Debian
PHP Version: 4.4.0
New Comment:
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?
Previous Comments:
------------------------------------------------------------------------
[2005-08-30 16:23:03] [EMAIL PROTECTED]
Why should it work if you disable the feature with:
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
------------------------------------------------------------------------
[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