From: vyshane Date: Fri, 25 Aug 2006 08:30:25 +0000 (+0000) Subject: Added has_capability check X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=25c38f25a1af716a47f23048eb53ec422b35096f;p=moodle.git Added has_capability check --- 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');