MDL-30376 - Glossary - Fixing ability to see the RSS feed for a glossary
This commit is contained in:
@@ -2748,7 +2748,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);
|
||||
@@ -2771,7 +2771,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');
|
||||
|
||||
@@ -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 @@
|
||||
|
||||
//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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user