You are here

function ldap_authorizations_user_authorizations in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_authorization/ldap_authorization.module \ldap_authorizations_user_authorizations()
  2. 7 ldap_authorization/ldap_authorization.module \ldap_authorizations_user_authorizations()

@rationale: need not be called from hook_user, so this function separated out so it can be called from a batch synchronization process for example

Parameters

drupal user object $user:

string $op indicating operation such as query, set, test_query, etc.:

string $consumer_type e.g. drupal_role, or og_groups:

string $context:

Return value

array of form: $authorizations[<consumer_type>][<authorization_id>]

6 calls to ldap_authorizations_user_authorizations()
LdapAuthenticationConf::allowUser in ldap_authentication/LdapAuthenticationConf.class.php
decide if a username is excluded or not
LdapAuthorizationBasicTests::testFlags in ldap_authorization/tests/BasicTests.test
authorization configuration flags tests clumped together
LdapAuthorizationOg1Tests::testFlags in ldap_authorization/tests/Og1Tests.test
authorization configuration flags tests clumped together
LdapAuthorizationOg2Tests::testFlags in ldap_authorization/tests/Og2Tests.test
authorization configuration flags tests clumped together
ldap_authorization_test_form_submit in ldap_authorization/ldap_authorization.admin.test.inc
submit handler function for ldap_authorization_test

... See full list

File

ldap_authorization/ldap_authorization.module, line 254
ldap authorization module

Code

function ldap_authorizations_user_authorizations(&$user, $op = 'query', $consumer_type = NULL, $context = NULL) {
  ldap_servers_module_load_include('inc', 'ldap_authorization', 'ldap_authorization');
  if ($consumer_type != NULL) {
    list($new_authorizations, $notifications) = _ldap_authorizations_user_authorizations($user, $op, $consumer_type, $context);
  }
  else {
    $consumers = ldap_authorization_get_consumers();
    $new_authorizations = array();
    $notifications = array();
    foreach ($consumers as $consumer_type => $consumer) {
      list($new_authorizations_i, $notifications_i) = _ldap_authorizations_user_authorizations($user, $op, $consumer_type, $context);
      $new_authorizations = $new_authorizations + $new_authorizations_i;
      $notifications = $notifications + $notifications_i;
    }
  }
  return array(
    $new_authorizations,
    $notifications,
  );
}