From 04755022552f94158e6e9f20fb07019c12130755 Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Sun, 29 Aug 2004 14:24:05 +0000 Subject: [PATCH] got rid of update_user_in_db, see bug 1833 --- lib/datalib.php | 22 ---------------------- lib/moodlelib.php | 4 ---- login/index.php | 4 ---- 3 files changed, 30 deletions(-) diff --git a/lib/datalib.php b/lib/datalib.php index 16e172b485..85b7e59753 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -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? diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 82bd6c09f3..a0dc68f474 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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; diff --git a/login/index.php b/login/index.php index 0aca572490..28fa5c9491 100644 --- a/login/index.php +++ b/login/index.php @@ -57,10 +57,6 @@ $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"); } -- 2.39.5