mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'patch_view_anon_event_MDL-66213' of git://github.com/Dave-B/moodle
This commit is contained in:
commit
e3f29b01c0
5 changed files with 26 additions and 3 deletions
|
@ -504,7 +504,14 @@ class report_log_table_log extends table_sql {
|
|||
|
||||
if (!($this->filterparams->logreader instanceof logstore_legacy\log\store)) {
|
||||
// Filter out anonymous actions, this is N/A for legacy log because it never stores them.
|
||||
$joins[] = "anonymous = 0";
|
||||
if ($this->filterparams->modid) {
|
||||
$context = context_module::instance($this->filterparams->modid);
|
||||
} else {
|
||||
$context = context_course::instance($this->filterparams->courseid);
|
||||
}
|
||||
if (!has_capability('moodle/site:viewanonymousevents', $context)) {
|
||||
$joins[] = "anonymous = 0";
|
||||
}
|
||||
}
|
||||
|
||||
$selector = implode(' AND ', $joins);
|
||||
|
|
|
@ -180,7 +180,11 @@ class report_loglive_renderable implements renderable {
|
|||
$filter->logreader = $readers[$this->selectedlogreader];
|
||||
$filter->date = $this->date;
|
||||
$filter->orderby = $this->order;
|
||||
$filter->anonymous = 0;
|
||||
|
||||
$context = context_course::instance($filter->courseid);
|
||||
if (!has_capability('moodle/site:viewanonymousevents', $context)) {
|
||||
$filter->anonymous = 0;
|
||||
}
|
||||
|
||||
return $filter;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue