function ldap_authorization_get_consumers in Lightweight Directory Access Protocol (LDAP) 7
Same name and namespace in other branches
- 8.2 ldap_authorization/ldap_authorization.module \ldap_authorization_get_consumers()
- 7.2 ldap_authorization/ldap_authorization.module \ldap_authorization_get_consumers()
Parameters
string $consumer_type is machine name of consumer type such as "drupal_role":
boolean $reset signifies clear static variable:
boolean $flatten signies return individual consumer not keyed on consumer type:
Return value
array (1) if $flatten is true, consumer configuration array otherwise (2) associative array of consumer configurations keyed on consumer type such as "drupal_role"
8 calls to ldap_authorization_get_consumers()
- LdapAuthenticationConf::allowUser in ldap_authentication/
LdapAuthenticationConf.class.php - decide if a username is excluded or not
- LdapAuthorizationConsumerConfAdmin::__construct in ldap_authorization/
LdapAuthorizationConsumerConfAdmin.class.php - Constructor Method
- ldap_authorizations_admin_index in ldap_authorization/
ldap_authorization.admin.inc - index of ldap authorization configurations
- ldap_authorizations_user_authorizations in ldap_authorization/
ldap_authorization.module - @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
- ldap_authorization_get_consumer_object in ldap_authorization/
ldap_authorization.module - param string $consumer_type is machine name of consumer such as drupal_role
File
- ldap_authorization/
ldap_authorization.module, line 204 - ldap authorization module
Code
function ldap_authorization_get_consumers($consumer_type = NULL, $reset = FALSE, $flatten = FALSE) {
static $consumers;
if ($reset || !is_array($consumers)) {
$consumers = module_invoke_all('ldap_authorization_consumer');
}
if (!$consumer_type) {
return $consumers;
}
elseif ($flatten) {
return isset($consumers[$consumer_type]) ? $consumers[$consumer_type] : FALSE;
}
else {
return isset($consumers[$consumer_type]) ? array(
$consumer_type => $consumers[$consumer_type],
) : array();
}
}