From 68d924ce8a3be374b4fa8b8bc07c609fa2d90db2 Mon Sep 17 00:00:00 2001 From: iarenaza Date: Tue, 25 Sep 2007 21:05:57 +0000 Subject: [PATCH] MDL-10921 LDAP Auth to Active Directory requires LDAP_OPT_REFERRALS option set; backported from HEAD --- auth/ldap/lib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/auth/ldap/lib.php b/auth/ldap/lib.php index 3b84365e729..77fa8f22514 100644 --- a/auth/ldap/lib.php +++ b/auth/ldap/lib.php @@ -1338,6 +1338,11 @@ function auth_ldap_connect($binddn='',$bindpwd=''){ ldap_set_option($connresult, LDAP_OPT_PROTOCOL_VERSION, $CFG->ldap_version); } + // Fix MDL-10921 + if ($this->config->user_type == 'ad') { + ldap_set_option($connresult, LDAP_OPT_REFERRALS, 0); + } + if (!empty($binddn)){ //bind with search-user //$debuginfo .= 'Using bind user'.$binddn.'and password:'.$bindpwd;