Skip to content

Commit

Permalink
Allow admin user to always get in, no matter what the authentication …
Browse files Browse the repository at this point in the history
…method
  • Loading branch information
moodler committed Nov 21, 2002
1 parent fd6a7ee commit 89b5432
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/moodlelib.php
Expand Up @@ -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;
}

Expand Down

0 comments on commit 89b5432

Please sign in to comment.