|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-05-21 17:54 UTC] marco at forgetaboutit dot net
[2010-07-20 15:40 UTC] art dot vanscheppingen at spilgames dot com
[2010-10-22 15:46 UTC] kalle@php.net
-Package: LDAP related
+Package: Documentation problem
[2010-10-23 15:26 UTC] kalle@php.net
-Summary: LDAP Referrals
+Summary: LDAP and Referrals
-Type: Documentation Problem
+Type: Bug
-Package: Documentation problem
+Package: LDAP related
[2010-10-23 15:26 UTC] kalle@php.net
[2011-02-26 20:19 UTC] marco at forgetaboutit dot net
[2013-09-30 11:13 UTC] mike@php.net
-Status: Open
+Status: Feedback
[2013-09-30 11:13 UTC] mike@php.net
[2013-09-30 16:18 UTC] marco at forgetaboutit dot net
-Status: Feedback
+Status: Open
[2013-09-30 16:18 UTC] marco at forgetaboutit dot net
[2013-09-30 18:00 UTC] mike@php.net
-Type: Bug
+Type: Documentation Problem
[2013-09-30 18:00 UTC] mike@php.net
[2017-01-09 16:48 UTC] heiglandreas@php.net
-PHP Version: Irrelevant
+PHP Version: 7.1
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 04:00:02 2025 UTC |
Description: ------------ I am trying to get a php application to follow ldap referrals, specifically when the local server is a slave, and is used as a read-only server for performance reasons, but has to write to a master server in order to add, modify or delete records. As far as I can tell all I need are three things. A) Set LDAP_OPT_REFERRALS to 1 using ldap_set_options() B) Set a callback function using ldap_set_rebind_proc() C) Create a very simple rebind function. The problem is that there is no documentation on the subject. For example, when I check LDAP_OPTS_REFERRALS using ldap_get_options(), I get an answer of either 0 (when I set it to 0 or false), and an answer of -1 (minus or dash 1) for any other setting, including 1 and TRUE, and it appears that the callback function isn't called. If someone can explain how it is supposed to work enough for me to get it working, I am happy to provide documentation / examples Test script: --------------- ldap_set_option($LDAP_CON, LDAP_OPT_REFERRALS, 1); ldap_set_rebind_proc($LDAP_CON, rebind_on_referral); ... function rebind_on_referral ($link_id, $ldap_url) { $binddn = $_SESSION['ldapab']['binddn']; $bindpw = $_SESSION['ldapab']['password']; if (!ldap_bind($link_id,$binddn,$bindpw)) return 1; // Error else return 0; // Success } Expected result: ---------------- callback function should be called, application should rebind to new ldap server and user should notice nothing Actual result: -------------- PHP appears to ignore the referral and ldap_error returns a "referral" message.