You are here

function _role_static_user_roles in Role Expire 8

Same name and namespace in other branches
  1. 6 role_expire.module \_role_static_user_roles()
  2. 7 role_expire.module \_role_static_user_roles()
  3. 2.x role_expire.module \_role_static_user_roles()

Store user roles for this page request.

Helper function.

Return value

array Array of roles

1 call to _role_static_user_roles()
role_expire_user_load in ./role_expire.module
Implements hook_user_load().

File

./role_expire.module, line 418
Role Expire module.

Code

function _role_static_user_roles($id, $roles = '') {
  static $user_roles = [];
  if (!isset($user_roles[$id]) && is_array($roles)) {
    $user_roles[$id] = $roles;
  }
  if (!isset($user_roles[$id])) {
    return FALSE;
  }
  else {
    return $user_roles[$id];
  }
}