From b489d37d562e84880e841c9ae85d777b95218bf7 Mon Sep 17 00:00:00 2001 From: "adrian@moodle.com" Date: Tue, 22 Nov 2011 11:52:36 +0800 Subject: [PATCH] MDL-27334 - forum - Fixed the issue of error session keys being displayed when trying to browse to a site without logging in. --- mod/forum/index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/forum/index.php b/mod/forum/index.php index 18f054b4d0ff8..2da19712d1fa7 100644 --- a/mod/forum/index.php +++ b/mod/forum/index.php @@ -68,7 +68,6 @@ $stryes = get_string('yes'); $strno = get_string('no'); $strrss = get_string('rss'); -$strsectionname = get_string('sectionname', 'format_'.$course->format); $searchform = forum_search_form($course); @@ -300,6 +299,9 @@ /// Now let's process the learning forums if ($course->id != SITEID) { // Only real courses have learning forums + // This is only required for use here and there needs to be a check to see if + // course id is the same as the site id. Moved from above. MDL-27334 + $strsectionname = get_string('sectionname', 'format_'.$course->format); // Add extra field for section number, at the front array_unshift($learningtable->head, $strsectionname); array_unshift($learningtable->align, 'center'); @@ -410,7 +412,7 @@ $PAGE->set_button($searchform); echo $OUTPUT->header(); -if (!isguestuser()) { +if (!isguestuser() && isloggedin()) { echo $OUTPUT->box_start('subscription'); echo html_writer::tag('div', html_writer::link(new moodle_url('/mod/forum/index.php', array('id'=>$course->id, 'subscribe'=>1, 'sesskey'=>sesskey())),