diff options
author | andi <andi@splitbrain.org> | 2005-02-14 21:19:48 +0100 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-02-14 21:19:48 +0100 |
commit | 0a59bcd29b8e4924d14acd7e7a9fda0bb820960d (patch) | |
tree | 5bf04742cfe2b63ea991ee2bcf13f48be58ca820 | |
parent | df52d0fe3dd80060536927497a5835b601e6b507 (diff) | |
download | rpg-0a59bcd29b8e4924d14acd7e7a9fda0bb820960d.tar.gz rpg-0a59bcd29b8e4924d14acd7e7a9fda0bb820960d.tar.bz2 |
added connection to ldap_error (fixes #143)
darcs-hash:20050214201948-9977f-2ae45b11e47042a0e61780afaf22184125c657a6.gz
-rw-r--r-- | inc/auth_ldap.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/inc/auth_ldap.php b/inc/auth_ldap.php index 991e53ecd..5ae71a2da 100644 --- a/inc/auth_ldap.php +++ b/inc/auth_ldap.php @@ -30,7 +30,6 @@ 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']){ @@ -38,7 +37,8 @@ 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); + if($cnf['debug']) + msg('LDAP errstr: '.htmlspecialchars(ldap_error($LDAP_CONNECTION)),0); } } } @@ -70,7 +70,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); + if($cnf['debug']) msg('LDAP errstr: '.htmlspecialchars(ldap_error($conn)),0); return true; } return false; @@ -107,7 +107,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); + if($cnf['debug']) msg('LDAP errstr: '.htmlspecialchars(ldap_error($conn)),0); return false; } @@ -137,7 +137,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); + if($cnf['debug']) msg('LDAP errstr: '.htmlspecialchars(ldap_error($conn)),0); return false; } $result = ldap_get_entries($conn, $sr); |