Skip to content

Commit

Permalink
MDL-36101 auth_shibboleth Show appropriate error message for suspende…
Browse files Browse the repository at this point in the history
…d accounts
  • Loading branch information
Michael Aherne authored and Michael Aherne committed Oct 17, 2012
1 parent 2ea4312 commit af402e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions auth/shibboleth/index.php
Expand Up @@ -41,9 +41,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);

Expand Down Expand Up @@ -87,7 +87,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');
}
}

Expand Down
1 change: 1 addition & 0 deletions auth/shibboleth/lang/en/auth_shibboleth.php
Expand Up @@ -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.';
Expand Down

0 comments on commit af402e5

Please sign in to comment.