Skip to content

Commit

Permalink
Merge branch 'MDL-65852-master' of git://github.com/ilya-catalyst/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols authored and stronk7 committed Nov 26, 2020
2 parents 9860796 + b71615f commit 5a92918
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion user/action_redir.php
Expand Up @@ -23,6 +23,7 @@
*/

require_once("../config.php");
require_once($CFG->dirroot . '/course/lib.php');

$formaction = required_param('formaction', PARAM_LOCALURL);
$id = required_param('id', PARAM_INT);
Expand Down Expand Up @@ -78,7 +79,8 @@

if (empty($plugin) AND $operationname == 'download_participants') {
// Check permissions.
if (has_capability('moodle/course:manageactivities', $context)) {
$pagecontext = ($course->id == SITEID) ? context_system::instance() : $context;
if (course_can_view_participants($pagecontext)) {
$plugins = core_plugin_manager::instance()->get_plugins_of_type('dataformat');
if (isset($plugins[$dataformat])) {
if ($plugins[$dataformat]->is_enabled()) {
Expand Down

0 comments on commit 5a92918

Please sign in to comment.