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

This commit is contained in:
skodak
2007-03-08 01:09:00 +00:00
parent e50916c80f
commit 7c3dab9f86
2 changed files with 2 additions and 3 deletions
+2 -2
View File
@@ -1468,9 +1468,9 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
echo '<p>Error: Could not insert a new entry to the Moodle log</p>'; // 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 .'\' ');
-1
View File
@@ -451,7 +451,6 @@ function forum_cron() {
mtrace(' sent.');
}
}
unset ($USER);
}
}