You are here

function cas_roles in CAS 7

Same name and namespace in other branches
  1. 6.3 cas.module \cas_roles()

Roles which should be granted to all CAS users.

Return value

An associative array with the role id as the key and the role name as value.

2 calls to cas_roles()
cas_login_check in ./cas.module
Checks to see if the user needs to be logged in.
cas_user_register in ./cas.module
Register a CAS user with some default values.

File

./cas.module, line 1236
Enables users to authenticate via a Central Authentication Service (CAS) Cas will currently work if the auto registration is turned on and will create user accounts automatically.

Code

function cas_roles() {
  $cas_roles =& drupal_static(__FUNCTION__);
  if (!isset($cas_roles)) {
    $cas_roles = array_intersect_key(user_roles(), array_filter(variable_get('cas_auto_assigned_role', array(
      DRUPAL_AUTHENTICATED_RID => TRUE,
    ))));
  }
  return $cas_roles;
}