From d986adf0f8c346f80e977c27788744c322db14fe Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Tue, 24 Mar 2015 20:16:53 +0000 Subject: [PATCH] Add a time out for the LDAP. --- resources/check_auth.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/check_auth.php b/resources/check_auth.php index d2d4b7518c..1e2e9d413f 100644 --- a/resources/check_auth.php +++ b/resources/check_auth.php @@ -104,11 +104,12 @@ require_once "resources/require.php"; if (strlen(check_str($_REQUEST["domain_name"])) > 0) { $domain_name = check_str($_REQUEST["domain_name"]); } - //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"]."=".$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; }