Skip to content

Commit

Permalink
Merge branch 'MDL-73365' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Jan 17, 2022
2 parents 475a400 + 2ae0424 commit 65041d8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions report/log/index.php
Expand Up @@ -50,8 +50,7 @@
if (!empty($id)) {
$params['id'] = $id;
} else {
$site = get_site();
$id = $site->id;
$id = $SITE->id;
}
if ($group !== 0) {
$params['group'] = $group;
Expand Down Expand Up @@ -106,12 +105,12 @@
$PAGE->set_pagelayout('report');

// Get course details.
$course = null;
if ($id) {
if ($id != $SITE->id) {
$course = $DB->get_record('course', array('id' => $id), '*', MUST_EXIST);
require_login($course);
$context = context_course::instance($course->id);
} else {
$course = $SITE;
require_login();
$context = context_system::instance();
$PAGE->set_context($context);
Expand Down Expand Up @@ -142,7 +141,7 @@
$USER->editing = $adminediting;
}

if (empty($course) || ($course->id == $SITE->id)) {
if ($course->id == $SITE->id) {
admin_externalpage_setup('reportlog', '', null, '', array('pagelayout' => 'report'));
$PAGE->set_title($SITE->shortname .': '. $strlogs);
} else {
Expand Down

0 comments on commit 65041d8

Please sign in to comment.