From 7c3dab9f864e50c0c67d165fb263e035a2e5b0b4 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 8 Mar 2007 01:09:00 +0000 Subject: [PATCH] MDL-8759 reverted previous incorrect patch with unset($USER), fixed logging function instead; solves the broken language in forum cron too; merged from MOODLE_18_STABLE --- lib/datalib.php | 4 ++-- mod/forum/lib.php | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/datalib.php b/lib/datalib.php index 28c6c030c6..80f09e81bb 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -1468,9 +1468,9 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user echo '

Error: Could not insert a new entry to the Moodle log

'; // Don't throw an error } -/// Store lastaccess times for the current user +/// Store lastaccess times for the current user, do not use in cron and other commandline scripts - if (!empty($USER->id) && ($userid == $USER->id) ) { + if (!empty($USER->id) && ($userid == $USER->id) && !defined('FULLME')) { $db->Execute('UPDATE '. $CFG->prefix .'user SET lastip=\''. $REMOTE_ADDR .'\', lastaccess=\''. $timenow .'\' WHERE id = \''. $userid .'\' '); diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 5fd4e4fda7..fecff4d298 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -451,7 +451,6 @@ function forum_cron() { mtrace(' sent.'); } } - unset ($USER); } } -- 2.39.5