From a96bb9ea181dd77263f6da8257ce74ee9898ca4a Mon Sep 17 00:00:00 2001 From: Troels Liebe Bentsen Date: Thu, 26 May 2005 16:36:12 +0200 Subject: Add referrals as an option(used by Active Directory) and move starttls where it needs to be. darcs-hash:20050526143612-ee6b9-f94290c33ae3677aafe4eac72146f3dd9f980ae6.gz --- inc/auth_ldap.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/inc/auth_ldap.php b/inc/auth_ldap.php index 71dc092a9..f3935df15 100644 --- a/inc/auth_ldap.php +++ b/inc/auth_ldap.php @@ -41,15 +41,26 @@ function auth_ldap_connect(){ if($cnf['debug']) msg('LDAP errstr: '.htmlspecialchars(ldap_error($LDAP_CONNECTION)),0); + } else { //use TLS (needs version 3) - if ($cnf['starttls']) { + if($cnf['starttls']) { if (!@ldap_start_tls($LDAP_CONNECTION)){ msg('Starting TLS failed',-1); if($cnf['debug']) msg('LDAP errstr: '.htmlspecialchars(ldap_error($LDAP_CONNECTION)),0); } } - } + // needs version 3 + if(isset($cnf['referrals'])) { + if(!@ldap_set_option($LDAP_CONNECTION, + LDAP_OPT_REFERRALS, + $cnf['referrals'])){ + msg('Setting LDAP referrals to off failed',-1); + if($cnf['debug']) + msg('LDAP errstr: '.htmlspecialchars(ldap_error($LDAP_CONNECTION)),0); + } + } + } } } return $LDAP_CONNECTION; -- cgit v1.2.3