You are here

README.txt in Simple LDAP 7.2

Simple LDAP User
================

This module allows authentication to the LDAP directory configured in the
Simple LDAP module. It also provides synchronization services both to and from
LDAP and Drupal. It supports mapping LDAP attributes to Drupal user object
fields (both native, and using Field API).

Configuration
=============

In addition to the configuration available in the administration UI, an
attribute map can be specified in settings.php, using the variable
$conf['simple_ldap_user_attribute_map'].

This variable is an array of key => value pairs.  The keys are the LDAP
attributes (lowercased) and the values are arrays of Drupal User field names.
This must be the machine name of the field.

If two or more Drupal User field names are present, an entry with the key
'#delimiter' MAY be added to mark how the LDAP field should be split.  If no
'#delimiter' entry is present, then Simple LDAP will map the user fields ot
a multivalue LDAP attribute.  Typical '#delimiter' values are '$' and "\r".

The administration page at admin/config/people/simple_ldap/profile will create
a valid simple_ldap_user_attribute_map for most installs.

Example:
--------
$conf['simple_ldap_user_attribute_map'] = array(

  // Generic example.
  'ldap-attribute' => array(
    'drupal-user-field-machine-name',
  ),

  // First name example.
  'givenname' => array(
    'field_first_name',
  ),

  // Last name example.
  'sn' => array(
    'field_last_name',
  ),

  // Timezone example (saved directly to users table, note there is no '#').
  'l' => array(
    'timezone',
  ),

  // Combined fields example.
  'displayname' => array(
      'field_first_name',
      'field_last_name',
      '#delimiter' => ' ',
    ),
  ),

  'street' => array(
    'field_street_1',
    'field_street_2',
    '#delimiter' => "\r",
  ),

);

Active Directory Example:
-------------------------
$conf['simple_ldap_user_attribute_map'] = array(
  'givenname' => array(
    'field_first_name',
  ),
  sn => array(
    'field_last_name',
  ),
  'cn' => array(
    'field_first_name',
    'field_last_name',
  ),
  'displayname' => array(
    'field_first_name',
    'field_last_name',
    '#delimiter' => ' ',
  ),
);

Testing
=======

The simpletests provided with this module automatically configure themeselves
to use the active configuration in order to perform a real-world test against
your real LDAP server.

THIS MEANS THAT DATA WILL BE ADDED/DELETED ON YOUR REAL LDAP SERVER!

The simpletests only operate against entries it creates, but in the event of a
failure, the test cannot clean up after itself. If you are testing a specific
configuration, it is recommended to run the test against a development or
staging directory first.

File

simple_ldap_user/README.txt
View source
  1. Simple LDAP User
  2. ================
  3. This module allows authentication to the LDAP directory configured in the
  4. Simple LDAP module. It also provides synchronization services both to and from
  5. LDAP and Drupal. It supports mapping LDAP attributes to Drupal user object
  6. fields (both native, and using Field API).
  7. Configuration
  8. =============
  9. In addition to the configuration available in the administration UI, an
  10. attribute map can be specified in settings.php, using the variable
  11. $conf['simple_ldap_user_attribute_map'].
  12. This variable is an array of key => value pairs. The keys are the LDAP
  13. attributes (lowercased) and the values are arrays of Drupal User field names.
  14. This must be the machine name of the field.
  15. If two or more Drupal User field names are present, an entry with the key
  16. '#delimiter' MAY be added to mark how the LDAP field should be split. If no
  17. '#delimiter' entry is present, then Simple LDAP will map the user fields ot
  18. a multivalue LDAP attribute. Typical '#delimiter' values are '$' and "\r".
  19. The administration page at admin/config/people/simple_ldap/profile will create
  20. a valid simple_ldap_user_attribute_map for most installs.
  21. Example:
  22. --------
  23. $conf['simple_ldap_user_attribute_map'] = array(
  24. // Generic example.
  25. 'ldap-attribute' => array(
  26. 'drupal-user-field-machine-name',
  27. ),
  28. // First name example.
  29. 'givenname' => array(
  30. 'field_first_name',
  31. ),
  32. // Last name example.
  33. 'sn' => array(
  34. 'field_last_name',
  35. ),
  36. // Timezone example (saved directly to users table, note there is no '#').
  37. 'l' => array(
  38. 'timezone',
  39. ),
  40. // Combined fields example.
  41. 'displayname' => array(
  42. 'field_first_name',
  43. 'field_last_name',
  44. '#delimiter' => ' ',
  45. ),
  46. ),
  47. 'street' => array(
  48. 'field_street_1',
  49. 'field_street_2',
  50. '#delimiter' => "\r",
  51. ),
  52. );
  53. Active Directory Example:
  54. -------------------------
  55. $conf['simple_ldap_user_attribute_map'] = array(
  56. 'givenname' => array(
  57. 'field_first_name',
  58. ),
  59. sn => array(
  60. 'field_last_name',
  61. ),
  62. 'cn' => array(
  63. 'field_first_name',
  64. 'field_last_name',
  65. ),
  66. 'displayname' => array(
  67. 'field_first_name',
  68. 'field_last_name',
  69. '#delimiter' => ' ',
  70. ),
  71. );
  72. Testing
  73. =======
  74. The simpletests provided with this module automatically configure themeselves
  75. to use the active configuration in order to perform a real-world test against
  76. your real LDAP server.
  77. THIS MEANS THAT DATA WILL BE ADDED/DELETED ON YOUR REAL LDAP SERVER!
  78. The simpletests only operate against entries it creates, but in the event of a
  79. failure, the test cannot clean up after itself. If you are testing a specific
  80. configuration, it is recommended to run the test against a development or
  81. staging directory first.