From 66af9472f9f0793f8c1860d1f8fafddd16614e54 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Tue, 24 Mar 2015 20:49:44 +0000 Subject: [PATCH] Fix the order of the LDAP options so its used before ldap_bind. --- resources/check_auth.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/check_auth.php b/resources/check_auth.php index 1e2e9d413f..f899ebe432 100644 --- a/resources/check_auth.php +++ b/resources/check_auth.php @@ -106,10 +106,10 @@ require_once "resources/require.php"; } $connect = ldap_connect($_SESSION["ldap"]["server_host"]["text"], $_SESSION["ldap"]["server_port"]["numeric"]) or die("Could not connect to the LDAP server."); + ldap_set_option($connect, LDAP_OPT_NETWORK_TIMEOUT, 10); + ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3); $bind_dn = $_SESSION["ldap"]["user_attribute"]["text"]."=".$username.",".$_SESSION["ldap"]["user_dn"]["text"]; $bind = ldap_bind($connect, $bind_dn, $_REQUEST["password"]); - ldap_set_option($connect, LDAP_OPT_NETWORK_TIMEOUT, 10); - //ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3); if ($bind) { $_SESSION['username'] = $username; }