function ldap_authorization_get_consumer_object in Lightweight Directory Access Protocol (LDAP) 7
Same name and namespace in other branches
- 8.2 ldap_authorization/ldap_authorization.module \ldap_authorization_get_consumer_object()
- 7.2 ldap_authorization/ldap_authorization.module \ldap_authorization_get_consumer_object()
param string $consumer_type is machine name of consumer such as drupal_role
Return value
consumer object
12 calls to ldap_authorization_get_consumer_object()
- LdapAuthenticationConf::allowUser in ldap_authentication/
LdapAuthenticationConf.class.php - decide if a username is excluded or not
- LdapAuthenticationTestCase::prepTestData in ldap_authentication/
tests/ ldap_authentication.test - prepTestData create an ldap_authorization configuration and stores fake ldap server configuration.
- LdapTestFunctions::prepConsumerConf in ldap_servers/
tests/ LdapTestFunctions.class.php - ldap_authorizations_admin_index in ldap_authorization/
ldap_authorization.admin.inc - index of ldap authorization configurations
- ldap_authorization_admin_form in ldap_authorization/
ldap_authorization.admin.inc - form for adding, updating, and deleting a single ldap authorization configuration
File
- ldap_authorization/
ldap_authorization.module, line 180 - ldap authorization module
Code
function ldap_authorization_get_consumer_object($consumer_type) {
$consumer = ldap_authorization_get_consumers($consumer_type, TRUE, TRUE);
if ($consumer) {
require_once drupal_get_path('module', $consumer['consumer_module']) . '/' . $consumer['consumer_class_file'];
$class = $consumer['consumer_class_name'];
$consumer_obj = new $class($consumer_type);
$consumer_obj->detailedWatchdogLog = variable_get('ldap_help_watchdog_detail', 0);
return $consumer_obj;
}
else {
return FALSE;
}
}