function hook_ldap_user_attrs_list_alter in Lightweight Directory Access Protocol (LDAP) 8.3
Same name and namespace in other branches
- 8.2 ldap_user/ldap_user.api.php \hook_ldap_user_attrs_list_alter()
- 7.2 ldap_user/ldap_user.api.php \hook_ldap_user_attrs_list_alter()
Hook_ldap_user_attrs_alter().
Alter list of available Drupal user targets (fields, properties, etc.) for ldap_user provisioning mapping form (admin/config/people/ldap/user)
Parameters
array $available_user_attrs: User attributes in the form of: [<field_type>.<field_name>] => array( 'name' => string for user friendly name for the UI, 'source' => LDAP attribute (even if target of sync. this should be refactored at some point to avoid confusion) 'configurable' => 'configurable_to_drupal' 0 | 1, is this configurable? 'configurable_to_ldap' => 0 | 1, is this configurable? 'user_tokens' => <user_tokens> 'convert' => 1 | 0 convert from binary to string for storage and comparison purposes 'direction' => LdapUserAttributesInterface::PROVISION_TO_DRUPAL or LdapUserAttributesInterface::PROVISION_TO_LDAP leave empty if configurable 'config_module' => module providing syncing configuration. 'prov_module' => module providing actual syncing of attributes. 'prov_events' => array( )
array $params: Parameters.
2 functions implement hook_ldap_user_attrs_list_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- ldap_servers_ldap_user_attrs_list_alter in ldap_servers/
ldap_servers.module - Implements hook_ldap_user_attrs_list_alter().
- ldap_user_ldap_user_attrs_list_alter in ldap_user/
ldap_user.module - Implements hook_ldap_user_attrs_list_alter().
1 invocation of hook_ldap_user_attrs_list_alter()
- SyncMappingHelper::processSyncMappings in ldap_user/
src/ Helper/ SyncMappingHelper.php - Derive synchronization mappings from configuration.
File
- ldap_user/
ldap_user.api.php, line 35 - Hooks and functions relevant to developers.
Code
function hook_ldap_user_attrs_list_alter(array &$available_user_attrs, array &$params) {
// Search for _ldap_user_attrs_list_alter for good examples the general trick
// to implementing this hook is make sure to specify config and sync module if
// its configurable by ldap_user module, don't specify convert user_tokens,
// direction. these will be set by UI and stored values be sure to merge with
// existing values as ldap_user configured values will already exist in
// $available_user_attrs.
}