]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8759 reverted previous incorrect patch with unset($USER), fixed logging function...
authorskodak <skodak>
Thu, 8 Mar 2007 01:09:00 +0000 (01:09 +0000)
committerskodak <skodak>
Thu, 8 Mar 2007 01:09:00 +0000 (01:09 +0000)
lib/datalib.php
mod/forum/lib.php

index 28c6c030c6cff91a34cba64524605929e757399e..80f09e81bb82b9b773b5c72fcf2836e11b3bc097 100644 (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 .'\' ');
index 5fd4e4fda72d5715d317882a3083b68368c89802..fecff4d2987e5e9c600e6c1fe101b9e936cb51bc 100644 (file)
@@ -451,7 +451,6 @@ function forum_cron() {
                     mtrace(' sent.');
                 }
             }
-            unset ($USER);
         }
     }