You are here

function hook_ldap_user_attributes_alter in Lightweight Directory Access Protocol (LDAP) 8.4

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' => 'configured_mapping' 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.

1 invocation of hook_ldap_user_attributes_alter()
LdapUserMappingBaseForm::loadAvailableMappings in ldap_user/src/Form/LdapUserMappingBaseForm.php
Derive synchronization mappings from configuration.

File

ldap_user/ldap_user.api.php, line 40

Code

function hook_ldap_user_attributes_alter(array &$available_user_attrs, array &$params) {

  // Search for _ldap_user_attributes_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.
}