From 22081dffb08f7f1e6c8ee8cf5fd06cf2690f9036 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Mon, 5 Apr 2021 19:50:39 +0800 Subject: [PATCH] Fix get_course_time() allowing users to view certificate early (#403) --- CHANGES.md | 3 ++- classes/certificate.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 46d9eb0..119cd55 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,10 +9,11 @@ Note - All hash comments refer to the issue number. Eg. #169 refers to https://g ### Added - Usage of github actions (#407). - The ability to show the description on the course page (#406). -- The ability to choose how to deliver the certificate (#401) +- The ability to choose how to deliver the certificate (#401). ### Fixed - Managers are now able to download their students' certificates (#412). +- Users being able to view the certificate before the required time set (#403). ## [3.8.5] - 2020-11-26 diff --git a/classes/certificate.php b/classes/certificate.php index 39168dd..c525ef2 100644 --- a/classes/certificate.php +++ b/classes/certificate.php @@ -227,7 +227,7 @@ class certificate { $totaltime = 0; } $delay = $log->$timefield - $lasthit; - if ($delay > ($CFG->sessiontimeout * 60)) { + if ($delay > $CFG->sessiontimeout) { // The difference between the last log and the current log is more than // the timeout Register session value so that we have found a session! $login = $log->$timefield;