Explorar o código

Update the LDAP authentication.

Mark Crane %!s(int64=10) %!d(string=hai) anos
pai
achega
31d2bb143c
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      resources/check_auth.php

+ 2 - 3
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;
 					}