소스 검색

Fix the order of the LDAP options so its used before ldap_bind.

Mark Crane 10 년 전
부모
커밋
c761eb8018
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      resources/check_auth.php

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