function _authcache_get_roles in Authenticated User Page Caching (Authcache) 7
Same name and namespace in other branches
- 6 authcache.admin.inc \_authcache_get_roles()
Helper function, get authcache user roles
Parameters
$all_roles = return all user roles:
Return value
array of user roles
2 calls to _authcache_get_roles()
- authcache_admin_config in ./
authcache.admin.inc - Main Authcache configuration form
- _authcache_pagecache_form in ./
authcache.admin.inc - Add new page caching rule to form (part of ajax)
File
- ./
authcache.admin.inc, line 469 - Admin forms and pages.
Code
function _authcache_get_roles($all_roles = FALSE) {
$roles = user_roles();
$roles[DRUPAL_AUTHENTICATED_RID] .= ' ' . t('(without additional roles)');
if ($all_roles) {
return $roles;
}
else {
$authcache_roles = array();
foreach (variable_get('authcache_roles', array()) as $key) {
$authcache_roles[$key] = $roles[$key];
}
return $authcache_roles;
}
}