From cee774d5fe93eaa4ce1b86975b992e2a258d5bde Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Wed, 1 Jun 2016 15:39:35 +0800 Subject: [PATCH] MDL-49651 forum: Check course access when mailing posts --- mod/forum/lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index fe08813..867b2f6 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -629,6 +629,10 @@ function forum_cron() { $cm =& $coursemodules[$forum->id]; // Do some checks to see if we can bail out now. + if (!can_access_course($course)) { + // The user does not have access to this course. + continue; + } // Only active enrolled users are in the list of subscribers. // This does not necessarily mean that the user is subscribed to the forum or to the discussion though. -- 2.8.2