mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
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:
parent
9d6773603d
commit
e3a232138a
1 changed files with 1 additions and 1 deletions
|
@ -2663,7 +2663,7 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
|
||||||
if (!$user and isset($USER->id)) {
|
if (!$user and isset($USER->id)) {
|
||||||
$db->Execute('UPDATE '. $CFG->prefix .'user SET lastIP=\''. $REMOTE_ADDR .'\', lastaccess=\''. $timenow .'\'
|
$db->Execute('UPDATE '. $CFG->prefix .'user SET lastIP=\''. $REMOTE_ADDR .'\', lastaccess=\''. $timenow .'\'
|
||||||
WHERE id = \''. $USER->id .'\' ');
|
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)) {
|
if (isstudent($courseid)) {
|
||||||
$db->Execute('UPDATE '. $CFG->prefix .'user_students SET timeaccess = \''. $timenow .'\' '.
|
$db->Execute('UPDATE '. $CFG->prefix .'user_students SET timeaccess = \''. $timenow .'\' '.
|
||||||
'WHERE course = \''. $courseid .'\' AND userid = \''. $userid .'\'');
|
'WHERE course = \''. $courseid .'\' AND userid = \''. $userid .'\'');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue