From 72f383b18c3aa7ff8da29c907c3f6d697ab38b85 Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 27 Oct 2006 16:28:20 +0000 Subject: [PATCH] Merged blog RSS fix MDL-7251 --- rss/file.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/rss/file.php b/rss/file.php index 13d98b6490..15bae41e62 100644 --- a/rss/file.php +++ b/rss/file.php @@ -62,19 +62,20 @@ //Check name of module if (!$isblog) { - $mods = get_list_of_plugins("mod"); + $mods = get_list_of_plugins('mod'); if (!in_array(strtolower($modulename), $mods)) { rss_not_found(); } + //Get course_module to check it's visible + if (!$cm = get_coursemodule_from_instance($modulename,$instance,$courseid)) { + rss_not_found(); + } + $context = get_context_instance(CONTEXT_MODULE, $cm->id); + $isuser = has_capability('moodle/course:view', $context, $userid); // Not ideal, this should be module-specific, but deferring until RSS gets a revamp with codes in the URLs + } else { + $context = get_context_instance(CONTEXT_COURSE, $course->id); + $isuser = has_capability('moodle/course:view', $context, $userid); } - - //Get course_module to check it's visible - if (!$isblog && (!$cm = get_coursemodule_from_instance($modulename,$instance,$courseid)) ) { - rss_not_found(); - } - - $context = get_context_instance(CONTEXT_MODULE, $cm->id); - $isuser = has_capability('moodle/course:view', $context, $userid); //Check for "security" if !course->guest or course->password if ($course->id != SITEID) { -- 2.39.5