mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Allow admin user to always get in, no matter what the authentication method
This commit is contained in:
parent
fd6a7ee524
commit
89b5432563
@ -1450,6 +1450,16 @@ function authenticate_user_login($username, $password) {
|
||||
return create_user_record($username, $password);
|
||||
}
|
||||
}
|
||||
|
||||
// It's possible that the user is the admin user, defined locally.
|
||||
$password = md5($password);
|
||||
if ($user = get_record_sql("SELECT u.id FROM user u, user_admins a
|
||||
WHERE u.id = a.user
|
||||
AND u.username = '$username'
|
||||
AND u.password = '$password'")) {
|
||||
return get_user_info_from_db("username", $username);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user