function cas_ldap_attributes in CAS Attributes 6.3
Same name and namespace in other branches
- 7 cas_ldap.module \cas_ldap_attributes()
Returns an array containing LDAP attributes for the specified user.
Parameters
$name:
2 calls to cas_ldap_attributes()
- cas_ldap_list in ./
cas_ldap.admin.inc - Lists available CAS Attributes.
- _cas_ldap_token_values in ./
cas_ldap.tokens.inc - Implements hook_token_values.
File
- ./
cas_ldap.module, line 77 - Allows user account and profile attributes to be automatically populated using tokens. Provides basic tokens for attributes returned by an LDAP server.
Code
function cas_ldap_attributes($name) {
$cas_attributes = variable_get('cas_attributes', array());
if (empty($cas_attributes['ldap']['server'])) {
// No CAS server configured.
return array();
}
// Initialize the server.
module_load_include('inc', 'ldapauth', 'includes/LDAPInterface');
_ldapauth_init($cas_attributes['ldap']['server']);
$attributes = _ldapauth_user_lookup($name);
return $attributes;
}