Permalink
Browse files

Allow admin user to always get in, no matter what the authentication …

…method
  • Loading branch information...
1 parent fd6a7ee commit 89b5432563590a7191c0d95c12c55bf94b9e131a moodler committed Nov 21, 2002
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/moodlelib.php
View
@@ -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;
}

0 comments on commit 89b5432

Please sign in to comment.