Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-30376 - Glossary - Fixing ability to see the RSS feed for a glossary

  • Loading branch information...
commit 10c8f7e60145d8c1e2e8b6d693bb310a091a297d 1 parent 24354ad
@jsnfwlr jsnfwlr authored samhemelryk committed
Showing with 4 additions and 4 deletions.
  1. +2 −2 mod/glossary/lib.php
  2. +2 −2 mod/glossary/rsslib.php
View
4 mod/glossary/lib.php
@@ -2721,7 +2721,7 @@ function glossary_extend_navigation($navigation, $course, $module, $cm) {
* @param navigation_node $glossarynode The node to add module settings to
*/
function glossary_extend_settings_navigation(settings_navigation $settings, navigation_node $glossarynode) {
- global $PAGE, $DB, $CFG, $USER;
+ global $PAGE, $DB, $CFG, $USER, $COURSE;
$mode = optional_param('mode', '', PARAM_ALPHA);
$hook = optional_param('hook', 'ALL', PARAM_CLEAN);
@@ -2744,7 +2744,7 @@ function glossary_extend_settings_navigation(settings_navigation $settings, navi
$glossary = $DB->get_record('glossary', array("id" => $PAGE->cm->instance));
- if (!empty($CFG->enablerssfeeds) && !empty($CFG->glossary_enablerssfeeds) && $glossary->rsstype && $glossary->rssarticles) {
+ if (!empty($CFG->enablerssfeeds) && !empty($CFG->glossary_enablerssfeeds) && $glossary->rsstype && $glossary->rssarticles && can_access_course($COURSE, $USER)) {
require_once("$CFG->libdir/rsslib.php");
$string = get_string('rsstype','forum');
View
4 mod/glossary/rsslib.php
@@ -4,7 +4,7 @@
//This function is the main entry point to glossary
//rss feeds generation.
function glossary_rss_get_feed($context, $args) {
- global $CFG, $DB;
+ global $CFG, $DB, $COURSE, $USER;
$status = true;
@@ -20,7 +20,7 @@ function glossary_rss_get_feed($context, $args) {
//context id from db should match the submitted one
//no specific capability required to view glossary entries so just check user is enrolled
- if ($context->id != $modcontext->id || !is_enrolled($context)) {
+ if ($context->id != $modcontext->id || !can_access_course($COURSE, $USER)) {
return null;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.