]> git.mjollnir.org Git - moodle.git/commitdiff
got rid of update_user_in_db, see bug 1833
authorgustav_delius <gustav_delius>
Sun, 29 Aug 2004 14:24:05 +0000 (14:24 +0000)
committergustav_delius <gustav_delius>
Sun, 29 Aug 2004 14:24:05 +0000 (14:24 +0000)
lib/datalib.php
lib/moodlelib.php
login/index.php

index 16e172b485d7f1198bf6905aa9b1879de6efe107..85b7e59753d5cfa50a224e2a363111e56aab24cf 100644 (file)
@@ -987,28 +987,6 @@ function get_user_info_from_db($field, $value) {
     return $user;
 }
 
-/**
-* Updates user record to record their last access
-* 
-* longdesc
-*
-*/
-function update_user_in_db() {
-
-   global $db, $USER, $REMOTE_ADDR, $CFG;
-
-   if (!isset($USER->id)) 
-       return false;
-
-   $timenow = time();
-   if ($db->Execute("UPDATE {$CFG->prefix}user SET lastIP='$REMOTE_ADDR', lastaccess='$timenow' 
-                     WHERE id = '$USER->id' ")) {
-       return true;
-   } else {
-       return false;
-   }
-}
-
 
 /**
 * Does this username and password specify a valid admin user?
index 82bd6c09f384d38d7f282ec346e8817adc9df6ec..a0dc68f47401a4788425edc0bdd5e69346916e88 100644 (file)
@@ -395,9 +395,6 @@ function require_login($courseid=0, $autologinguest=true) {
                     print_header();
                     notice(get_string("studentnotallowed", "", fullname($USER, true)), "$CFG->wwwroot/");
                 }
-
-            } else {  // just update their last login time
-                update_user_in_db();
             }
             return;   // user is a member of this course.
         }
@@ -415,7 +412,6 @@ function require_login($courseid=0, $autologinguest=true) {
                     notice(get_string("guestsnotallowed", "", $course->fullname));
                     break;
                 case 1: // Guests allowed
-                    update_user_in_db();
                     return;
                 case 2: // Guests allowed with key (drop through)
                     break;
index 0aca5724902c5ceae38ba5cddd6e4295539cd22c..28fa5c94918ac332dc3960b841fad9d02e82c556 100644 (file)
                 $USER->lastname   = " ";
             }
     
-            if (!update_user_in_db()) {
-                error("Weird error: User not found");
-            }
-            
             if (!update_user_login_times()) {
                 error("Wierd error: could not update login records");
             }