From 3aafb7d9d257070eacfe7f6b7a4905a2cef22d4b Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Thu, 16 Aug 2007 04:05:31 +0000 Subject: [PATCH] merged fix for MDL-10818, do not display broken graph when user has no permission to view actities graph --- course/user.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/course/user.php b/course/user.php index cbf9152ae0..d212054eed 100644 --- a/course/user.php +++ b/course/user.php @@ -155,8 +155,11 @@ if (empty($stats)) { 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))); -- 2.39.5