function ldap_authorization_get_consumer_object in Lightweight Directory Access Protocol (LDAP) 7.2
Same name and namespace in other branches
- 8.2 ldap_authorization/ldap_authorization.module \ldap_authorization_get_consumer_object()
- 7 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
object
13 calls to ldap_authorization_get_consumer_object()
- LdapAuthenticationConf::allowUser in ldap_authentication/
LdapAuthenticationConf.class.php - Decide if a username is excluded or not.
- LdapAuthorizationBasicTests::testUIForms in ldap_authorization/
tests/ BasicTests.test - LdapTestFunctions::prepConsumerConf in ldap_test/
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 203 - 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;
}
}