]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes notices when username doesn't exist
authormoodler <moodler>
Fri, 28 Jan 2005 16:59:43 +0000 (16:59 +0000)
committermoodler <moodler>
Fri, 28 Jan 2005 16:59:43 +0000 (16:59 +0000)
lib/moodlelib.php

index cbfa9e26687f30d6ebeb09d432716c39abf7e435..5001c8d85853eecb70cce0adb1e54396716bee6c 100644 (file)
@@ -1740,7 +1740,10 @@ function authenticate_user_login($username, $password) {
 
     // First try to find the user in the database
 
-    $user = get_user_info_from_db('username', $username);
+    if (!$user = get_user_info_from_db('username', $username)) {
+        $user->id = 0;     // Not a user
+        $user->auth = $CFG->auth;
+    }
 
     // Sort out the authentication method we are using.