Skip to content

Commit

Permalink
Merge branch 'MOODLE_32_MDL-51892' of https://github.com/fwsl/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_32_STABLE
  • Loading branch information
andrewnicols committed Oct 26, 2017
2 parents 3a31987 + 858fd41 commit fc62095
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lib/classes/event/user_login_failed.php
Expand Up @@ -70,7 +70,23 @@ public static function get_name() {
public function get_description() {
// Note that username could be any random user input.
$username = s($this->other['username']);
return "Login failed for the username '{$username}' for the reason with id '{$this->other['reason']}'.";
$reasonid = $this->other['reason'];
$loginfailed = 'Login failed for user';
switch ($reasonid){
case 1:
return $loginfailed." '{$username}'. User does not exist (error ID '{$reasonid}').";
case 2:
return $loginfailed." '{$username}'. User is suspended (error ID '{$reasonid}').";
case 3:
return $loginfailed." '{$username}'. Most likely the password did not match (error ID '{$reasonid}').";
case 4:
return $loginfailed." '{$username}'. User is locked out (error ID '{$reasonid}').";
case 5:
return $loginfailed." '{$username}'. User is not authorised (error ID '{$reasonid}').";
default:
return $loginfailed." '{$username}', error ID '{$reasonid}'.";

}
}

/**
Expand Down

0 comments on commit fc62095

Please sign in to comment.