Projet

Général

Profil

Révision 32700c57

Ajouté par Assos Assos il y a environ 5 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ldap/ldap_user/ldap_user.api.php
2 2

  
3 3
/**
4 4
 * @file
5
 * Hooks and functions relevant to developers
6
 *
5
 * Hooks and functions relevant to developers.
7 6
 */
8 7

  
9 8
/**
10
 * hook_ldap_user_attrs_alter().
9
 * Hook_ldap_user_attrs_alter().
11 10
 *
12
 * alter list of available drupal user targets (fields, properties, etc.)
11
 * Alter list of available drupal user targets (fields, properties, etc.)
13 12
 *   for ldap_user provisioning mapping form (admin/config/people/ldap/user)
14 13
 *
15 14
 * return array with elements of the form:
......
38 37
 *   'data' ($user->data array.  field_name will be used as key such as $user->data[<field_name>] = mapped value
39 38
 * 'field_name' machine name of property, field, profile2 field, or data associative array key
40 39
 */
41

  
42 40
function hook_ldap_user_attrs_list_alter(&$available_user_attrs, &$params) {
43 41

  
44
 /** search for _ldap_user_attrs_list_alter for good examples
42
  /** search for _ldap_user_attrs_list_alter for good examples
45 43
  * the general trick to implementing this hook is:
46 44
  *   make sure to specify config and synch module
47 45
  *   if its configurable by ldap_user module, don't specify convert, user_tokens, direction.  these will be set by UI and stored values
......
50 48

  
51 49
}
52 50

  
53

  
54

  
55 51
/**
56 52
 * Allow modules to alter the user object in the context of an ldap entry
57
 * during synchronization
53
 * during synchronization.
58 54
 *
59 55
 * @param array $edit
60 56
 *   The edit array (see hook_user_insert). Make changes to this object as
61 57
 *   required.
62
 * @param array $ldap_user, for structure @see LdapServer::userUserNameToExistingLdapEntry()
63
 *   Array, the ldap user object relating to the drupal user
58
 * @param array $ldap_user,
59
 *   for structure @see LdapServer::userUserNameToExistingLdapEntry()
60
 *   Array, the ldap user object relating to the drupal user.
64 61
 * @param object $ldap_server
65
 *   The LdapServer object from which the ldap entry was fetched
62
 *   The LdapServer object from which the ldap entry was fetched.
66 63
 * @param int $prov_event
67
 *
68
 *
69 64
 */
70 65
function hook_ldap_user_edit_user_alter(&$edit, &$ldap_user, $ldap_server, $prov_event) {
71 66
  $edit['myfield'] = $ldap_server->getAttributeValue($ldap_user, 'myfield');

Formats disponibles : Unified diff