You are here

function ldap_authorization_og2_rid_from_role_name in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.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 254
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];
}