mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
Merge branch 'MDL-68280' of https://github.com/paulholden/moodle
This commit is contained in:
commit
58e73daa59
1 changed files with 9 additions and 4 deletions
|
@ -4430,10 +4430,15 @@ function authenticate_user_login($username, $password, $ignorelockout=false, &$f
|
||||||
if (!\core\session\manager::validate_login_token($logintoken)) {
|
if (!\core\session\manager::validate_login_token($logintoken)) {
|
||||||
$failurereason = AUTH_LOGIN_FAILED;
|
$failurereason = AUTH_LOGIN_FAILED;
|
||||||
|
|
||||||
// Trigger login failed event.
|
// Trigger login failed event (specifying the ID of the found user, if available).
|
||||||
$event = \core\event\user_login_failed::create(array('userid' => $user->id,
|
\core\event\user_login_failed::create([
|
||||||
'other' => array('username' => $username, 'reason' => $failurereason)));
|
'userid' => ($user->id ?? 0),
|
||||||
$event->trigger();
|
'other' => [
|
||||||
|
'username' => $username,
|
||||||
|
'reason' => $failurereason,
|
||||||
|
],
|
||||||
|
])->trigger();
|
||||||
|
|
||||||
error_log('[client '.getremoteaddr()."] $CFG->wwwroot Invalid Login Token: $username ".$_SERVER['HTTP_USER_AGENT']);
|
error_log('[client '.getremoteaddr()."] $CFG->wwwroot Invalid Login Token: $username ".$_SERVER['HTTP_USER_AGENT']);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue