Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-36101 auth_shibboleth Show appropriate error message for suspende…

…d accounts
  • Loading branch information...
commit 6dc38156a257a056edf2650f8478aaf431a7dd03 1 parent 15b3f43
Michael Aherne authored samhemelryk committed
View
7 auth/shibboleth/index.php
@@ -37,9 +37,9 @@
/// Check if the user has actually submitted login data to us
- if ($shibbolethauth->user_login($frm->username, $frm->password)) {
+ if ($shibbolethauth->user_login($frm->username, $frm->password)
+ && $user = authenticate_user_login($frm->username, $frm->password)) {
- $user = authenticate_user_login($frm->username, $frm->password);
enrol_check_plugins($user);
session_set_user($user);
@@ -83,7 +83,8 @@
}
else {
- // For some weird reason the Shibboleth user couldn't be authenticated
+ // The Shibboleth user couldn't be mapped to a valid Moodle user
+ print_error('shib_invalid_account_error', 'auth_shibboleth');
}
}
View
1  auth/shibboleth/lang/en/auth_shibboleth.php
@@ -51,6 +51,7 @@
$string['auth_shib_only'] = 'Shibboleth only';
$string['auth_shib_only_description'] = 'Check this option if a Shibboleth authentication shall be enforced';
$string['auth_shib_username_description'] = 'Name of the webserver Shibboleth environment variable that shall be used as Moodle username';
+$string['shib_invalid_account_error'] = 'You seem to be Shibboleth authenticated but Moodle has no valid account for your username. Your account may not exist or it may have been suspended.';
$string['shib_no_attributes_error'] = 'You seem to be Shibboleth authenticated but Moodle didn\'t receive any user attributes. Please check that your Identity Provider releases the necessary attributes ({$a}) to the Service Provider Moodle is running on or inform the webmaster of this server.';
$string['shib_not_all_attributes_error'] = 'Moodle needs certain Shibboleth attributes which are not present in your case. The attributes are: {$a}<br />Please contact the webmaster of this server or your Identity Provider.';
$string['shib_not_set_up_error'] = 'Shibboleth authentication doesn\'t seem to be set up correctly because no Shibboleth environment variables are present for this page. Please consult the <a href="README.txt">README</a> for further instructions on how to set up Shibboleth authentication or contact the webmaster of this Moodle installation.';
Please sign in to comment.
Something went wrong with that request. Please try again.