From 6214b779ff14fbf280a3f798136ff787e182f4e5 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Thu, 16 Aug 2007 04:04:35 +0000 Subject: [PATCH] MDL-10818, do not display broken graph when user has no permission to view activity graph --- course/user.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/course/user.php b/course/user.php index 653573d3c70..277302be74b 100644 --- a/course/user.php +++ b/course/user.php @@ -140,7 +140,10 @@ error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/user.php?id='.$course->id.'&user='.$user->id.'&mode=outline'); } - echo '
'.get_string('statisticsgraph').'
'; + // MDL-10818, do not display broken graph when user has no permission to view graph + if (has_capability('moodle/site:viewreports', get_context_instance(CONTEXT_COURSE, $id))) { + echo '
'.get_string('statisticsgraph').'
'; + } // What the heck is this about? -- MD $stats = stats_fix_zeros($stats,$param->timeafter,$param->table,(!empty($param->line2)),(!empty($param->line3)));