summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTroels Liebe Bentsen <tlb@rapanden.dk>2005-05-26 16:36:12 +0200
committerTroels Liebe Bentsen <tlb@rapanden.dk>2005-05-26 16:36:12 +0200
commita96bb9ea181dd77263f6da8257ce74ee9898ca4a (patch)
treec76d211527711bba120eac1626cd3e00c36105be
parent5749f1ce740e4cfd6d886e8d2fda6b8782389d33 (diff)
downloadrpg-a96bb9ea181dd77263f6da8257ce74ee9898ca4a.tar.gz
rpg-a96bb9ea181dd77263f6da8257ce74ee9898ca4a.tar.bz2
Add referrals as an option(used by Active Directory) and move starttls where it needs to be.
darcs-hash:20050526143612-ee6b9-f94290c33ae3677aafe4eac72146f3dd9f980ae6.gz
-rw-r--r--inc/auth_ldap.php15
1 files 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;