From fac5c85cf26e6ba2bb32bd420127cc2a7706a52f Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Tue, 24 Mar 2015 19:54:59 +0000 Subject: [PATCH] Update the LDAP authentication. --- resources/check_auth.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/check_auth.php b/resources/check_auth.php index 10ef6962e5..d2d4b7518c 100644 --- a/resources/check_auth.php +++ b/resources/check_auth.php @@ -107,9 +107,8 @@ require_once "resources/require.php"; //ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3); $connect = ldap_connect($_SESSION["ldap"]["server_host"]["text"], $_SESSION["ldap"]["server_port"]["numeric"]) or die("Could not connect to the LDAP server."); - $bind_dn = $_SESSION["ldap"]["user_attribute"]["text"]."=".$_REQUEST["password"].",".$_SESSION["ldap"]["user_dn"]["text"]; - - $bind = ldap_bind($connect, $bind_dn, $_SESSION["ldap"]["bind_password"]["text"]); + $bind_dn = $_SESSION["ldap"]["user_attribute"]["text"]."=".$username.",".$_SESSION["ldap"]["user_dn"]["text"]; + $bind = ldap_bind($connect, $bind_dn, $_REQUEST["password"]); if ($bind) { $_SESSION['username'] = $username; }