Merge branch 'MDL-63716-master' of git://github.com/damyon/moodle

This commit is contained in:
Andrew Nicols 2018-11-13 11:20:54 +08:00
commit ba20486ffe
3 changed files with 12 additions and 2 deletions

View file

@ -26,6 +26,7 @@ defined('MOODLE_INTERNAL') || die;
require_once($CFG->libdir.'/completionlib.php');
require_once($CFG->libdir.'/filelib.php');
require_once($CFG->libdir.'/datalib.php');
require_once($CFG->dirroot.'/course/format/lib.php');
define('COURSE_MAX_LOGS_PER_PAGE', 1000); // Records.
@ -3665,6 +3666,8 @@ function course_view($context, $sectionnumber = 0) {
$event = \core\event\course_viewed::create($eventdata);
$event->trigger();
user_accesstime_log($context->instanceid);
}
/**

View file

@ -2763,7 +2763,10 @@ function require_login($courseorid = null, $autologinguest = true, $cm = null, $
$PAGE->set_course($course);
}
// Set accesstime or the user will appear offline which messes up messaging.
user_accesstime_log($course->id);
// Do not update access time for webservice or ajax requests.
if (!WS_SERVER && !AJAX_SCRIPT) {
user_accesstime_log($course->id);
}
return;
}
@ -2972,7 +2975,10 @@ function require_login($courseorid = null, $autologinguest = true, $cm = null, $
}
// Finally access granted, update lastaccess times.
user_accesstime_log($course->id);
// Do not update access time for webservice or ajax requests.
if (!WS_SERVER && !AJAX_SCRIPT) {
user_accesstime_log($course->id);
}
}

View file

@ -165,6 +165,7 @@ the groupid field.
until all settings have been set. The additional parameters are used recursively and shouldn't be need to be explicitly passed in when calling
the function from other parts of Moodle.
The return value: $settingsoutput is an array of setting names and the values that were set by the function.
* Webservices no longer update the lastaccess time for a user in a course. Call core_course_view_course() manually if needed.
=== 3.5 ===