3 // Don't let lib/setup.php set any cookies
4 // as we will be executing under the OS security
5 // context of the user we are trying to login, rather than
9 require_once(dirname(dirname(dirname(__FILE__
)))."/config.php");
11 //HTTPS is potentially required in this page
14 $authsequence = get_enabled_auth_plugins(true); // auths, in sequence
15 if (!in_array('ldap',$authsequence,true)) {
16 print_error('ldap_isdisabled','auth');
19 $authplugin = get_auth_plugin('ldap');
20 if (empty($authplugin->config
->ntlmsso_enabled
)) {
21 print_error('ntlmsso_isdisabled','auth');
24 $sesskey = required_param('sesskey', PARAM_RAW
);
25 $file = $CFG->dirroot
. '/pix/spacer.gif';
27 if ($authplugin->ntlmsso_magic($sesskey)
28 && file_exists($file)) {
30 if (!empty($authplugin->config
->ntlmsso_ie_fastpath
)) {
31 if (check_browser_version('MSIE')) {
32 redirect($CFG->wwwroot
. '/auth/ldap/ntlmsso_finish.php');
38 header('Content-Type: image/gif');
39 header('Content-Length: '.filesize($file));
42 $handle=fopen($file,'r');
47 print_error('ntlmsso_iwamagicnotenabled','auth');