|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); 00004 00005 //HTTPS is required in this page when $CFG->loginhttps enabled 00006 $PAGE->https_required(); 00007 00008 $PAGE->set_url('/auth/ldap/ntlmsso_attempt.php'); 00009 $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM)); 00010 00011 // Define variables used in page 00012 $site = get_site(); 00013 00014 $authsequence = get_enabled_auth_plugins(true); // auths, in sequence 00015 if (!in_array('ldap', $authsequence, true)) { 00016 print_error('ldap_isdisabled', 'auth'); 00017 } 00018 00019 $authplugin = get_auth_plugin('ldap'); 00020 if (empty($authplugin->config->ntlmsso_enabled)) { 00021 print_error('ntlmsso_isdisabled', 'auth_ldap'); 00022 } 00023 00024 $sesskey = sesskey(); 00025 00026 // Display the page header. This makes redirect respect the timeout we specify 00027 // here (and not add 3 more secs) which in turn prevents a bug in both IE 6.x 00028 // and FF 3.x (Windows version at least) where javascript timers fire up even 00029 // when we've already left the page that set the timer. 00030 $loginsite = get_string("loginsite"); 00031 $PAGE->navbar->add($loginsite); 00032 $PAGE->set_title("$site->fullname: $loginsite"); 00033 $PAGE->set_heading($site->fullname); 00034 echo $OUTPUT->header(); 00035 00036 $msg = '<p>'.get_string('ntlmsso_attempting', 'auth_ldap').'</p>' 00037 . '<img width="1", height="1" ' 00038 . ' src="' . $CFG->wwwroot . '/auth/ldap/ntlmsso_magic.php?sesskey=' 00039 . $sesskey . '" />'; 00040 redirect($CFG->wwwroot . '/auth/ldap/ntlmsso_finish.php', $msg, 3);