]> git.mjollnir.org Git - moodle.git/commitdiff
Fix for add_to_log to stop notification of invalid call to isteacher. Some actions...
authormjollnir_ <mjollnir_>
Thu, 27 Jan 2005 02:29:53 +0000 (02:29 +0000)
committermjollnir_ <mjollnir_>
Thu, 27 Jan 2005 02:29:53 +0000 (02:29 +0000)
lib/datalib.php

index abb757a43f0ca21a4b3d6fbfc10805c8e8133c88..a30e674e1261c3644a31462a6d32a630f300b7f4 100644 (file)
@@ -2663,7 +2663,7 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
     if (!$user and isset($USER->id)) {
         $db->Execute('UPDATE '. $CFG->prefix .'user SET lastIP=\''. $REMOTE_ADDR .'\', lastaccess=\''. $timenow .'\'
                      WHERE id = \''. $USER->id .'\' ');
-        if ($courseid != SITEID) {
+        if ($courseid != SITEID && !empty($courseid)) { // logins etc dont't have a courseid and isteacher will break without it.
             if (isstudent($courseid)) {
                 $db->Execute('UPDATE '. $CFG->prefix .'user_students SET timeaccess = \''. $timenow .'\' '.
                              'WHERE course = \''. $courseid .'\' AND userid = \''. $userid .'\'');