mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-66213 report_loglive: Do not look up course 0
This commit is contained in:
parent
f6fe70d075
commit
16d4515411
@ -174,6 +174,10 @@ class report_loglive_renderable implements renderable {
|
||||
$filter = new \stdClass();
|
||||
if (!empty($this->course)) {
|
||||
$filter->courseid = $this->course->id;
|
||||
$context = context_course::instance($filter->courseid);
|
||||
if (!has_capability('moodle/site:viewanonymousevents', $context)) {
|
||||
$filter->anonymous = 0;
|
||||
}
|
||||
} else {
|
||||
$filter->courseid = 0;
|
||||
}
|
||||
@ -181,11 +185,6 @@ class report_loglive_renderable implements renderable {
|
||||
$filter->date = $this->date;
|
||||
$filter->orderby = $this->order;
|
||||
|
||||
$context = context_course::instance($filter->courseid);
|
||||
if (!has_capability('moodle/site:viewanonymousevents', $context)) {
|
||||
$filter->anonymous = 0;
|
||||
}
|
||||
|
||||
return $filter;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user