MDL-36620 - Blog, RSS - Preventing Guests from viewing the RSS of site level blogs
authorJason Fowler <phalacee@gmail.com>
Thu, 22 Nov 2012 07:44:27 +0000 (15:44 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 8 Jan 2013 06:06:32 +0000 (14:06 +0800)
blog/rsslib.php

index b6195bd..73cd5ee 100644 (file)
@@ -163,6 +163,13 @@ function blog_rss_get_feed($context, $args) {
         return '';
     }
 
+    if ($CFG->bloglevel == BLOG_SITE_LEVEL) {
+        if (isguestuser()) {
+            debugging(get_string('nopermissiontoshow','error'));
+            return '';
+        }
+    }
+
     $sitecontext = context_system::instance();
     if (!has_capability('moodle/blog:view', $sitecontext)) {
         return null;