mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Auth: Better error message when SSO fails
This commit is contained in:
parent
1ca484a3b7
commit
016bac47b7
@ -233,14 +233,21 @@ class auth_plugin_mnet
|
||||
if ($mnetrequest->send($remotepeer) === true) {
|
||||
$remoteuser = (object) $mnetrequest->response;
|
||||
} else {
|
||||
foreach ($mnetrequest->error as $code => $errormessage) {
|
||||
foreach ($mnetrequest->error as $errormessage) {
|
||||
list($code, $message) = array_map('trim',explode(':', $errormessage, 2));
|
||||
if($code == 702) {
|
||||
$site = get_site();
|
||||
print_error('mnet_session_prohibited','mnet', $remotewwwroot, $site->fullname);
|
||||
exit;
|
||||
}
|
||||
$message .= "ERROR $code:<br/>$errormessage<br/>";
|
||||
}
|
||||
error("RPC auth/mnet/user_authorise:<br/>$message");
|
||||
}
|
||||
|
||||
if (empty($remoteuser) or empty($remoteuser->username)) {
|
||||
error(get_string('unknownerror', 'mnet'));
|
||||
print_error('unknownerror', 'mnet');
|
||||
exit;
|
||||
}
|
||||
|
||||
// get the local record for the remote user
|
||||
|
@ -15,6 +15,10 @@
|
||||
require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
|
||||
require_once $CFG->dirroot . '/mnet/xmlrpc/client.php';
|
||||
|
||||
if (!$site = get_site()) {
|
||||
print_error('mnet_session_prohibited', 'mnet', '', '');
|
||||
}
|
||||
|
||||
// grab the GET params
|
||||
$token = required_param('token', PARAM_BASE64);
|
||||
$remotewwwroot = required_param('idp', PARAM_URL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user