summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-01-29 18:09:06 +0100
committerandi <andi@splitbrain.org>2005-01-29 18:09:06 +0100
commit93470c105af0ae116dda52665e16c8eef839b887 (patch)
treef6acae73c9f7f8248091baced35c43ceb907a872
parent1f8f3264b0cbc85eb38d4a58383dbf821fe5251e (diff)
downloadrpg-93470c105af0ae116dda52665e16c8eef839b887.tar.gz
rpg-93470c105af0ae116dda52665e16c8eef839b887.tar.bz2
ldap debugging (#98)
darcs-hash:20050129170906-9977f-6e3ec7d9b9c171631766ba1265de97a59159331d.gz
-rw-r--r--inc/auth_ldap.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/inc/auth_ldap.php b/inc/auth_ldap.php
index 1376f883e..825a13ae3 100644
--- a/inc/auth_ldap.php
+++ b/inc/auth_ldap.php
@@ -26,6 +26,7 @@ function auth_ldap_connect(){
$LDAP_CONNECTION = @ldap_connect($cnf['server']);
if(!$LDAP_CONNECTION){
msg("LDAP: couldn't connect to LDAP server",-1);
+ if($cnf['debug']) msg('LDAP errstr: 'htmlspecialchars(ldap_error()),0);
return false;
}
if($cnf['version']){
@@ -33,6 +34,7 @@ function auth_ldap_connect(){
LDAP_OPT_PROTOCOL_VERSION,
$cnf['version'])){
msg('Setting LDAP Protocol version '.$cnf['version'].' failed',-1);
+ if($cnf['debug']) msg('LDAP errstr: 'htmlspecialchars(ldap_error()),0);
}
}
}
@@ -64,6 +66,7 @@ function auth_checkPass($user,$pass){
//try to bind with dn
if(@ldap_bind($conn,$dn,$pass)){
+ if($cnf['debug']) msg('LDAP errstr: 'htmlspecialchars(ldap_error()),0);
return true;
}
return false;
@@ -100,6 +103,7 @@ function auth_getUserData($user){
//anonymous bind to lookup userdata
if(!@ldap_bind($conn)){
msg("LDAP: can not bind anonymously",-1);
+ if($cnf['debug']) msg('LDAP errstr: 'htmlspecialchars(ldap_error()),0);
return false;
}
@@ -129,6 +133,7 @@ function auth_getUserData($user){
$sr = @ldap_search($conn, $cnf['grouptree'], $filter);
if(!$sr){
msg("LDAP: Reading group memberships failed",-1);
+ if($cnf['debug']) msg('LDAP errstr: 'htmlspecialchars(ldap_error()),0);
return false;
}
$result = ldap_get_entries($conn, $sr);