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
This commit is contained in:
+1
-1
@@ -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 .'\'');
|
||||
|
||||
Reference in New Issue
Block a user