You are here

function ldap_authorization_og2_rid_from_role_name in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_authorization/ldap_authorization_og/ldap_authorization_og.module \ldap_authorization_og2_rid_from_role_name()
  2. 7 ldap_authorization/ldap_authorization_og/ldap_authorization_og.module \ldap_authorization_og2_rid_from_role_name()
2 calls to ldap_authorization_og2_rid_from_role_name()
LdapAuthorizationConsumerOG::mappingExamples in ldap_authorization/ldap_authorization_og/LdapAuthorizationConsumerOG.class.php
Get list of mappings based on existing Organic Groups and roles.
LdapAuthorizationConsumerOG::normalizeMappings in ldap_authorization/ldap_authorization_og/LdapAuthorizationConsumerOG.class.php

File

ldap_authorization/ldap_authorization_og/ldap_authorization_og.module, line 147
Controls organic group membership based on LDAP values.

Code

function ldap_authorization_og2_rid_from_role_name($entity_type, $bundle, $gid, $role_name) {
  $roles = og_roles($entity_type, $bundle, 0, FALSE, TRUE);
  $roles_flipped = array_flip($roles);
  return empty($roles_flipped[$role_name]) ? NULL : $roles_flipped[$role_name];
}