mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Tidy up some of the dox
This commit is contained in:
parent
466558e349
commit
92710226a5
1 changed files with 5 additions and 1 deletions
|
@ -1443,6 +1443,9 @@ function authenticate_user_login($username, $password) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is the admin, then just use internal methods
|
// If this is the admin, then just use internal methods
|
||||||
|
// Doing this first (even though it's less efficient) because
|
||||||
|
// the chosen authentication method might hang and lock the
|
||||||
|
// admin out.
|
||||||
if ($user = get_record_sql("SELECT u.id FROM user u, user_admins a
|
if ($user = get_record_sql("SELECT u.id FROM user u, user_admins a
|
||||||
WHERE u.id = a.user
|
WHERE u.id = a.user
|
||||||
AND u.username = '$username'
|
AND u.username = '$username'
|
||||||
|
@ -1450,12 +1453,13 @@ function authenticate_user_login($username, $password) {
|
||||||
return get_user_info_from_db("username", $username);
|
return get_user_info_from_db("username", $username);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// OK, the user is a normal user, so try and authenticate them
|
||||||
require_once("$CFG->dirroot/auth/$CFG->auth/lib.php");
|
require_once("$CFG->dirroot/auth/$CFG->auth/lib.php");
|
||||||
|
|
||||||
if (auth_user_login($username, $password)) { // Successful authentication
|
if (auth_user_login($username, $password)) { // Successful authentication
|
||||||
|
|
||||||
if ($user = get_user_info_from_db("username", $username)) {
|
if ($user = get_user_info_from_db("username", $username)) {
|
||||||
if ($md5password <> $user->password) {
|
if ($md5password <> $user->password) { // Update local copy of password for reference
|
||||||
set_field("user", "password", $md5password, "username", $username);
|
set_field("user", "password", $md5password, "username", $username);
|
||||||
}
|
}
|
||||||
return $user;
|
return $user;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue