From cc0d91bf2b0f79b8d485afef2ef0c98b5f8fe1dd Mon Sep 17 00:00:00 2001
From: guerinaxel <guerinaxel57@gmail.com>
Date: Fri, 20 Jun 2014 17:00:06 +0200
Subject: [PATCH] LDAP Authentication faulty

The LDAP Authentication only test the POST authentication however we're allowed to authenticate using the function (for example via WebServices).
---
 htdocs/core/login/functions_ldap.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php
index 1806d9f2970..403530ac80b 100644
--- a/htdocs/core/login/functions_ldap.php
+++ b/htdocs/core/login/functions_ldap.php
@@ -55,7 +55,7 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
 	$login='';
 	$resultFetchUser='';
 
-	if (! empty($_POST["username"]))
+	if (!empty($_POST["username"]) || $usertotest)
 	{
 		// If test username/password asked, we define $test=false and $login var if ok, set $_SESSION["dol_loginmesg"] if ko
 		$ldaphost=$dolibarr_main_auth_ldap_host;
@@ -228,4 +228,4 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
 }
 
 
-?>
\ No newline at end of file
+?>
-- 
GitLab