$string['cachedef_databasemeta'] = 'Database meta information';
$string['cachedef_eventinvalidation'] = 'Event invalidation';
$string['cachedef_externalbadges'] = 'External badges for particular user';
-$string['cachedef_get_suspended_userids'] = 'List of suspended user identifiers per course';
+$string['cachedef_suspended_userids'] = 'List of suspended users per course';
$string['cachedef_gradecondition'] = 'User grades cached for evaluating conditional availability';
$string['cachedef_groupdata'] = 'Course group information';
$string['cachedef_htmlpurifier'] = 'HTML Purifier - cleaned content';
* or enrolment has expired or not started.
*
* @param context $context context in which user enrolment is checked.
- * @param bool $context Enable or disable (default) the request cache
+ * @param bool $usecache Enable or disable (default) the request cache
* @return array list of suspended user id's.
*/
function get_suspended_userids(context $context, $usecache = false) {
// Check the cache first for performance reasons if enabled.
if ($usecache) {
- $cache = cache::make('core', 'get_suspended_userids');
+ $cache = cache::make('core', 'suspended_userids');
$susers = $cache->get($context->id);
if ($susers !== false) {
return $susers;
'simpledata' => true
),
- // For the function get_suspended_userids() in core_access.
- 'get_suspended_userids' => array(
+ // Caches suspended userids by course.
+ // The key is the courseid, the value is an array of user ids.
+ 'suspended_userids' => array(
'mode' => cache_store::MODE_REQUEST,
'simplekeys' => true,
'simpledata' => true,
context_course::instance($instance->courseid)->mark_dirty(); // reset enrol caches
// Invalidate core_access cache for get_suspended_userids.
- cache_helper::invalidate_by_definition('core', 'get_suspended_userids', array(), array($instance->courseid));
+ cache_helper::invalidate_by_definition('core', 'suspended_userids', array(), array($instance->courseid));
// Trigger event.
$event = \core\event\user_enrolment_updated::create(