2007-11-14 22:08:38 +00:00
|
|
|
<?php
|
|
|
|
|
2007-11-14 22:08:55 +00:00
|
|
|
require_once(dirname(dirname(dirname(__FILE__)))."/config.php");
|
2007-11-14 22:08:38 +00:00
|
|
|
|
|
|
|
//HTTPS is potentially required in this page
|
|
|
|
httpsrequired();
|
|
|
|
|
2010-01-16 15:39:56 +00:00
|
|
|
$PAGE->set_url('/auth/ldap/ntlmsso_finish.php');
|
2009-10-15 02:34:31 +00:00
|
|
|
|
2007-11-14 22:08:38 +00:00
|
|
|
/// Define variables used in page
|
2009-11-01 09:10:09 +00:00
|
|
|
$site = get_site();
|
2007-11-14 22:08:38 +00:00
|
|
|
|
|
|
|
$authsequence = get_enabled_auth_plugins(true); // auths, in sequence
|
|
|
|
if (!in_array('ldap',$authsequence,true)) {
|
|
|
|
print_error('ldap_isdisabled','auth');
|
|
|
|
}
|
|
|
|
|
|
|
|
$authplugin = get_auth_plugin('ldap');
|
|
|
|
if (empty($authplugin->config->ntlmsso_enabled)) {
|
2009-06-11 03:34:46 +00:00
|
|
|
print_error('ntlmsso_isdisabled','auth_ldap');
|
2007-11-14 22:08:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// If ntlmsso_finish() succeeds, then the code never returns,
|
|
|
|
// so we only worry about failure.
|
|
|
|
if (!$authplugin->ntlmsso_finish()) {
|
|
|
|
// Redirect to login, saying "don't try again!"
|
2009-02-14 16:21:14 +00:00
|
|
|
// Display the page header. This makes redirect respect the timeout we specify
|
|
|
|
// here (and not add 3 more secs).
|
|
|
|
$loginsite = get_string("loginsite");
|
2009-09-03 05:40:41 +00:00
|
|
|
$PAGE->navbar->add($loginsite);
|
|
|
|
$PAGE->set_title("$site->fullname: $loginsite");
|
|
|
|
$PAGE->set_heading($site->fullname);
|
|
|
|
echo $OUTPUT->header();
|
2009-11-01 11:55:14 +00:00
|
|
|
redirect($CFG->httpswwwroot . '/login/index.php?authldap_skipntlmsso=1',
|
2009-06-11 03:34:46 +00:00
|
|
|
get_string('ntlmsso_failed','auth_ldap'), 3);
|
2007-11-14 22:08:38 +00:00
|
|
|
}
|