From fd25c7d5f85c202930755de47398ec0e2a328512 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Wed, 14 Nov 2018 10:19:24 +0800 Subject: [PATCH] MDL-64004 webservice: Do not update accesstime Do not update the automatically update the course access time when a course is accessed via a webservice or ajax. --- lib/moodlelib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 18e7a74cef5..4cfc923df44 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -3108,7 +3108,10 @@ function require_course_login($courseorid, $autologinguest = true, $cm = null, $ // If $PAGE->course, and hence $PAGE->context, have not already been set up properly, set them up now. $PAGE->set_course($PAGE->course); } - user_accesstime_log(SITEID); + // Do not update access time for webservice or ajax requests. + if (!WS_SERVER && !AJAX_SCRIPT) { + user_accesstime_log(SITEID); + } return; } else {