From 4a09b0fbcddba5d77feda49ac08ff3692d679fb3 Mon Sep 17 00:00:00 2001 From: rs-a-demyanenko <153287512+rs-a-demyanenko@users.noreply.github.com> Date: Mon, 26 Feb 2024 11:43:58 +0300 Subject: [PATCH] [MOODLE-19] add course filter --- classes/log.php | 8 ++++++++ version.php | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/classes/log.php b/classes/log.php index d34d934..a2c4cd6 100644 --- a/classes/log.php +++ b/classes/log.php @@ -344,6 +344,7 @@ public function get_module_list() { */ public function get_course_list() { global $DB; + global $USER; $courses = []; @@ -358,6 +359,13 @@ public function get_course_list() { } } + if (!is_siteadmin($USER->id)) { + if (has_capability('availability/examus2:logaccess_course', $coursecontext) && + !is_enrolled($coursecontext, $USER->id)) { + continue; + } + } + if ($course->id == SITEID) { $courses[$course->id] = format_string($course->fullname) . ' (' . get_string('site') . ')'; } else { diff --git a/version.php b/version.php index d6609a1..7e0784b 100644 --- a/version.php +++ b/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'availability_examus2'; -$plugin->version = 2024020801; -$plugin->release = 'v2.0.32'; +$plugin->version = 2024021401; +$plugin->release = 'v2.0.33'; $plugin->requires = 2018111800; $plugin->maturity = MATURITY_STABLE;