You are here

function shib_auth_generate_rolenames in Shibboleth Authentication 6.4

Same name and namespace in other branches
  1. 7.4 shib_auth.module \shib_auth_generate_rolenames()

This function gets the username

Parameters

$force If it is TRUE, the cache is regenerated:

3 calls to shib_auth_generate_rolenames()
shib_auth_form_alter in ./shib_auth.module
Alters user_login form for the shibboleth authentication module.
shib_auth_role_assignment in ./shib_auth.module
Assign roles to the user's session
_shib_auth_list_rules in ./shib_auth_roles_forms.inc
This function lists all rules, and let the admin to do certain actions with them

File

./shib_auth.module, line 1198
Drupal Shibboleth authentication module.

Code

function shib_auth_generate_rolenames($force) {
  if (!isset($_SESSION['shib_auth_rolecache']) || $force) {
    $_SESSION['shib_auth_rolecache'] = array();
    $query = db_query('SELECT rid, name FROM {role}');
    while ($item = db_fetch_array($query)) {
      $rolecache[$item['rid']] = $item['name'];
    }
    $_SESSION['shib_auth_rolecache'] = $rolecache;
  }
}