3 require_once(dirname(dirname(dirname(__FILE__
))).'/config.php');
5 //HTTPS is required in this page when $CFG->loginhttps enabled
6 $PAGE->https_required();
8 $PAGE->set_url('/auth/ldap/ntlmsso_attempt.php');
9 $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM
));
11 // Define variables used in 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_ldap');
26 // Display the page header. This makes redirect respect the timeout we specify
27 // here (and not add 3 more secs) which in turn prevents a bug in both IE 6.x
28 // and FF 3.x (Windows version at least) where javascript timers fire up even
29 // when we've already left the page that set the timer.
30 $loginsite = get_string("loginsite");
31 $PAGE->navbar
->add($loginsite);
32 $PAGE->set_title("$site->fullname: $loginsite");
33 $PAGE->set_heading($site->fullname
);
34 echo $OUTPUT->header();
36 $msg = '<p>'.get_string('ntlmsso_attempting', 'auth_ldap').'</p>'
37 . '<img width="1", height="1" '
38 . ' src="' . $CFG->wwwroot
. '/auth/ldap/ntlmsso_magic.php?sesskey='
40 redirect($CFG->wwwroot
. '/auth/ldap/ntlmsso_finish.php', $msg, 3);