Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
9fd91f8e
Commit
9fd91f8e
authored
Oct 26, 2017
by
Andrew Nicols
Browse files
Merge branch 'master-MDL-51892' of
https://github.com/fwsl/moodle
parents
6e186498
5fd7c11d
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/classes/event/user_login_failed.php
View file @
9fd91f8e
...
...
@@ -70,7 +70,23 @@ class user_login_failed extends base {
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
}
'."
;
}
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment