diff --git a/auth/mnet/auth.php b/auth/mnet/auth.php
index 4b675fd308f..7e0307bac39 100644
--- a/auth/mnet/auth.php
+++ b/auth/mnet/auth.php
@@ -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:
$errormessage
";
}
error("RPC auth/mnet/user_authorise:
$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
diff --git a/auth/mnet/land.php b/auth/mnet/land.php
index 5350f56c824..4c58f2e3300 100644
--- a/auth/mnet/land.php
+++ b/auth/mnet/land.php
@@ -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);