From 5f49619b36c2bf307730002c1716c247b443587b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 31 Dec 2007 13:42:17 +0000 Subject: [PATCH] Fix: debugage authentification ldap --- htdocs/main.inc.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 136de912a87..9c003f4fac8 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -318,15 +318,14 @@ if (! isset($_SESSION["dol_login"])) $result=$ldap->connect_bind(); $resultCheck=$ldap->checkPass($usertotest,$passwordtotest); - print 'result:'.$resultCheck; - if ($result > 0) + print 'result:'.$resultCheck.'
'; + if ($resultCheck) { - if ($result == 2) - { - dolibarr_syslog("Authentification ok (en mode LDAP)"); - $login=$_POST["username"]; - $test=false; - } + dolibarr_syslog("Authentification ok (en mode LDAP)"); + $login=$_POST["username"]; + $test=false; + } + /* if ($result == 1) { dolibarr_syslog("Authentification ko bad password (en mode LDAP) pour '".$_POST["username"]."'"); @@ -337,6 +336,7 @@ if (! isset($_SESSION["dol_login"])) } $ldap->close(); } + */ else { dolibarr_syslog("Authentification ko failed to connect to LDAP (en mode LDAP) pour '".$_POST["username"]."'"); @@ -344,6 +344,7 @@ if (! isset($_SESSION["dol_login"])) $langs->load('main'); $langs->load('other'); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorBadLoginPassword"); + $ldap->close(); } } }