* @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);
$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');
//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;
//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;
}
}