function get_content() {
global $USER, $CFG, $DB;
- if (!has_capability('mod/glossary:read', $this->context)) {
- return "";
- }
-
if (empty($this->config->glossary)) {
$this->content->text = get_string('notyetconfigured','block_glossary_random');
$this->content->footer = '';
* @return bool
*/
function glossary_print_recent_activity($course, $viewfullnames, $timestart) {
- global $CFG, $USER, $DB, $OUTPUT, $PAGE;
+ global $CFG, $USER, $DB, $OUTPUT;
//TODO: use timestamp in approved field instead of changing timemodified when approving in 2.0
if (!defined('GLOSSARY_RECENT_ACTIVITY_LIMIT')) {
$approvals = array();
foreach ($ids as $glinstanceid => $glcmid) {
$context = get_context_instance(CONTEXT_MODULE, $glcmid);
- if (!has_capability('mod/glossary:read', $context)) {
- continue;
- }
// get records glossary entries that are approved if user has no capability to approve entries.
if (has_capability('mod/glossary:approve', $context)) {
$approvals[] = ' ge.glossaryid = :glsid'.$glinstanceid.' ';
$glossary = $DB->get_record('glossary', array("id" => $PAGE->cm->instance));
- if (!empty($CFG->enablerssfeeds) && !empty($CFG->glossary_enablerssfeeds) && $glossary->rsstype && $glossary->rssarticles && has_capability('mod/glossary:read', $PAGE->cm->context)) {
+ if (!empty($CFG->enablerssfeeds) && !empty($CFG->glossary_enablerssfeeds) && $glossary->rsstype && $glossary->rssarticles && can_access_course($PAGE->course, $USER)) {
require_once("$CFG->libdir/rsslib.php");
$string = get_string('rsstype','forum');
defined('MOODLE_INTERNAL') || die();
-$module->version = 2011120200; // The current module version (Date: YYYYMMDDXX)
+$module->version = 2011112900; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2011112900; // Requires this Moodle version
$module->component = 'mod_glossary'; // Full name of the plugin (used for diagnostics)
$module->cron = 0;