Skip to content

Commit

Permalink
Merge branch '47914-26' of git://github.com/samhemelryk/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_26_STABLE
  • Loading branch information
marinaglancy committed Oct 28, 2014
2 parents 7e49daa + e68de10 commit 6ef51ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion report/stats/graph.php
Expand Up @@ -57,7 +57,8 @@
if (!report_stats_can_access_user_report($user, $course, true)) {
require_capability('report/stats:view', $coursecontext);
}

} else if ($mode === STATS_MODE_DETAILED) {
print_error('invaliduser');
} else {
require_capability('report/stats:view', $coursecontext);
}
Expand Down
6 changes: 5 additions & 1 deletion report/stats/locallib.php
Expand Up @@ -161,7 +161,11 @@ function report_stats_report($course, $report, $mode, $user, $roleid, $time) {
echo '</div>';
echo '</form>';

if (!empty($report) && !empty($time)) {
// Display the report if:
// - A report has been selected.
// - A time frame has been provided
// - If the mode is not detailed OR a valid user has been selected.
if (!empty($report) && !empty($time) && ($mode !== STATS_MODE_DETAILED || !empty($userid))) {
if ($report == STATS_REPORT_LOGINS && $course->id != SITEID) {
print_error('reportnotavailable');
}
Expand Down

0 comments on commit 6ef51ef

Please sign in to comment.