From 25c38f25a1af716a47f23048eb53ec422b35096f Mon Sep 17 00:00:00 2001 From: vyshane Date: Fri, 25 Aug 2006 08:30:25 +0000 Subject: [PATCH] Added has_capability check --- course/report/participation/index.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/course/report/participation/index.php b/course/report/participation/index.php index 96d549ecb4..972144b293 100644 --- a/course/report/participation/index.php +++ b/course/report/participation/index.php @@ -28,13 +28,15 @@ } require_login($course->id); - - if (!isteacher($course->id)) { + $context = get_context_instance(CONTEXT_COURSE, $course->id); + + if (!has_capability('moodle/site:viewreports', $context)) { print_error('mustbeteacher', '', $CFG->wwwroot.'/course/view.php?id='.$course->id); } + add_to_log($course->id, "course", "report participation", "report/participation/index.php?id=$course->id", $course->id); - + $strparticipation = get_string('participationreport'); $strviews = get_string('views'); $strposts = get_string('posts'); -- 2.39.5