You are here

function ldap_authorization_og_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_og_rid_from_role_name()
  2. 7 ldap_authorization/ldap_authorization_og/ldap_authorization_og.module \ldap_authorization_og_rid_from_role_name()

Derive og role id from role name

Parameters

string $role_name as og role name:

Return value

int og role id

4 calls to ldap_authorization_og_rid_from_role_name()
LdapAuthorizationConsumerOG::normalizeMappings in ldap_authorization/ldap_authorization_og/LdapAuthorizationConsumerOG.class.php
LdapAuthorizationOg1Tests::testBasicFunctionsAndApi in ldap_authorization/tests/Og1Tests.test
just make sure install succeeds and og and ldap_authorization_og functions work as designed
LdapAuthorizationOg1Tests::testFlags in ldap_authorization/tests/Og1Tests.test
authorization configuration flags tests clumped together
LdapAuthorizationOg1Tests::testLogons in ldap_authorization/tests/Og1Tests.test
authorization configuration flags tests clumped together

File

ldap_authorization/ldap_authorization_og/ldap_authorization_og.module, line 243
controls organic group membership based on LDAP values

Code

function ldap_authorization_og_rid_from_role_name($role_name) {
  $roles = og_roles(0);
  $rids = array_flip($roles);
  return isset($rids[$role_name]) ? $rids[$role_name] : FALSE;
}