Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 87b61e39bf6827894629161da614a93d1f16df47 1 parent 186577a
Jason Fowler phalacee authored samhemelryk committed

Showing 2 changed files with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. +2 2 mod/glossary/lib.php
  2. +2 2 mod/glossary/rsslib.php
4 mod/glossary/lib.php
@@ -2747,7 +2747,7 @@ function glossary_extend_navigation($navigation, $course, $module, $cm) {
2747 2747 * @param navigation_node $glossarynode The node to add module settings to
2748 2748 */
2749 2749 function glossary_extend_settings_navigation(settings_navigation $settings, navigation_node $glossarynode) {
2750   - global $PAGE, $DB, $CFG, $USER;
  2750 + global $PAGE, $DB, $CFG, $USER, $COURSE;
2751 2751
2752 2752 $mode = optional_param('mode', '', PARAM_ALPHA);
2753 2753 $hook = optional_param('hook', 'ALL', PARAM_CLEAN);
@@ -2770,7 +2770,7 @@ function glossary_extend_settings_navigation(settings_navigation $settings, navi
2770 2770
2771 2771 $glossary = $DB->get_record('glossary', array("id" => $PAGE->cm->instance));
2772 2772
2773   - if (!empty($CFG->enablerssfeeds) && !empty($CFG->glossary_enablerssfeeds) && $glossary->rsstype && $glossary->rssarticles) {
  2773 + if (!empty($CFG->enablerssfeeds) && !empty($CFG->glossary_enablerssfeeds) && $glossary->rsstype && $glossary->rssarticles && can_access_course($COURSE, $USER)) {
2774 2774 require_once("$CFG->libdir/rsslib.php");
2775 2775
2776 2776 $string = get_string('rsstype','forum');
4 mod/glossary/rsslib.php
@@ -4,7 +4,7 @@
4 4 //This function is the main entry point to glossary
5 5 //rss feeds generation.
6 6 function glossary_rss_get_feed($context, $args) {
7   - global $CFG, $DB;
  7 + global $CFG, $DB, $COURSE, $USER;
8 8
9 9 $status = true;
10 10
@@ -20,7 +20,7 @@ function glossary_rss_get_feed($context, $args) {
20 20
21 21 //context id from db should match the submitted one
22 22 //no specific capability required to view glossary entries so just check user is enrolled
23   - if ($context->id != $modcontext->id || !is_enrolled($context)) {
  23 + if ($context->id != $modcontext->id || !can_access_course($COURSE, $USER)) {
24 24 return null;
25 25 }
26 26 }

0 comments on commit 87b61e3

Please sign in to comment.
Something went wrong with that request. Please try again.