You are here

function hook_ldap_user_edit_user_alter in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.4 ldap_user/ldap_user.api.php \hook_ldap_user_edit_user_alter()
  2. 8.2 ldap_user/ldap_user.api.php \hook_ldap_user_edit_user_alter()
  3. 8.3 ldap_user/ldap_user.api.php \hook_ldap_user_edit_user_alter()

Allow modules to alter the user object in the context of an ldap entry during synchronization.

Parameters

array $edit: The edit array (see hook_user_insert). Make changes to this object as required.

array $ldap_user,: for structure @see LdapServer::userUserNameToExistingLdapEntry() Array, the ldap user object relating to the drupal user.

object $ldap_server: The LdapServer object from which the ldap entry was fetched.

int $prov_event:

1 invocation of hook_ldap_user_edit_user_alter()
LdapUserConf::entryToUserEdit in ldap_user/LdapUserConf.class.php
Populate $user edit array (used in hook_user_save, hook_user_update, etc) ... should not assume all attribues are present in ldap entry.

File

ldap_user/ldap_user.api.php, line 65
Hooks and functions relevant to developers.

Code

function hook_ldap_user_edit_user_alter(&$edit, &$ldap_user, $ldap_server, $prov_event) {
  $edit['myfield'] = $ldap_server
    ->getAttributeValue($ldap_user, 'myfield');
}