From 068b4fc6b624bfb0413640ef479a224f02858062 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Wed, 28 Nov 2007 14:00:58 +0000
Subject: [PATCH] Print error message from LDAP when the bind operation fails.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@71 44740490-163a-0410-bde0-09ae8108e29a
---
 www/auth/login.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/auth/login.php b/www/auth/login.php
index 0a468950a..4e106a898 100644
--- a/www/auth/login.php
+++ b/www/auth/login.php
@@ -48,7 +48,8 @@ if (isset($_POST['username'])) {
 		}
 		*/
 		if (!ldap_bind($ds, $dn, $pwd)) {
-			$error = "Bind failed, wrong username or password. Tried with DN=[" . $dn . "] DNPattern=[" . $config->getValue('auth.ldap.dnpattern') . "]";
+			$error = "Bind failed, wrong username or password. Tried with DN=[" . $dn . "] DNPattern=[" . $config->getValue('auth.ldap.dnpattern')
+				. "] Error=[" . ldap_error($ds) . "] ErrNo=[" . ldap_errno($ds) . "]";
 			
 			$logger->log(LOG_NOTICE, $session->getTrackID(), 'AUTH', 'ldap', 'Fail', $_POST['username'], $_POST['username'] . ' failed to authenticate');
 			
-- 
GitLab