You are here

public function LdapAuthorizationConsumerDrupalRole::existingRolesByRoleName in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_authorization/ldap_authorization_drupal_role/LdapAuthorizationConsumerRole.class.php \LdapAuthorizationConsumerDrupalRole::existingRolesByRoleName()

Parameters

boolean $reset to reset static values:

Return value

associative array() keyed on lowercase role names with values of array('rid' => role id, 'role_name' => mixed case role name)

4 calls to LdapAuthorizationConsumerDrupalRole::existingRolesByRoleName()
LdapAuthorizationConsumerDrupalRole::createConsumer in ldap_authorization/ldap_authorization_drupal_role/LdapAuthorizationConsumerRole.class.php
LdapAuthorizationConsumerDrupalRole::getDrupalRoleIdFromRoleName in ldap_authorization/ldap_authorization_drupal_role/LdapAuthorizationConsumerRole.class.php
LdapAuthorizationConsumerDrupalRole::populateConsumersFromConsumerIds in ldap_authorization/ldap_authorization_drupal_role/LdapAuthorizationConsumerRole.class.php
LdapAuthorizationConsumerDrupalRole::validateAuthorizationMappingTarget in ldap_authorization/ldap_authorization_drupal_role/LdapAuthorizationConsumerRole.class.php
* Validate authorization mappings on LDAP Authorization OG Admin form. * *

File

ldap_authorization/ldap_authorization_drupal_role/LdapAuthorizationConsumerRole.class.php, line 232

Class

LdapAuthorizationConsumerDrupalRole

Code

public function existingRolesByRoleName($reset = FALSE) {
  static $roles_by_name;
  if ($reset || !is_array($roles_by_name)) {
    $roles_by_name = array();
    foreach (array_flip(user_roles(TRUE)) as $role_name => $rid) {
      $roles_by_name[drupal_strtolower($role_name)]['rid'] = $rid;
      $roles_by_name[drupal_strtolower($role_name)]['role_name'] = $role_name;
    }
  }
  return $roles_by_name;
}