mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-90 authenticate_user_login() - don't accidentally return a bogus $user
While I don't quite understand why we need that $user->id=0, at _least_ make double sure we don't return it! Callers assume that if we return an object===success and a user acct that just does not exist will return an dummy object.
This commit is contained in:
parent
a4c371ece6
commit
a668c80845
1 changed files with 3 additions and 1 deletions
|
@ -3059,8 +3059,10 @@ function authenticate_user_login($username, $password) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($user->id===0) {
|
||||
return false;
|
||||
}
|
||||
return $user;
|
||||
|
||||
}
|
||||
|
||||
// failed if all the plugins have failed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue