Skip to content
Permalink
Browse files

Fix for add_to_log to stop notification of invalid call to isteacher.…

… Some actions aren't associated with a course and therefore isteacher shouldn't get called
  • Loading branch information...
mjollnir_
mjollnir_ committed Jan 27, 2005
1 parent 9d67736 commit e3a232138a361d2d7bc745df712f09bac7a3596e
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/datalib.php
@@ -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 .'\'');

0 comments on commit e3a2321

Please sign in to comment.
You can’t perform that action at this time.