module.authent-ldap.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. // Until we develop a mean to adress this within the setup, let's check that this instance
  3. // of PHP has the php_ldap extension
  4. //
  5. if (function_exists('ldap_connect'))
  6. {
  7. SetupWebPage::AddModule(
  8. __FILE__, // Path to the current file, all other file names are relative to the directory containing this file
  9. 'authent-ldap/1.0.0',
  10. array(
  11. // Identification
  12. //
  13. 'label' => 'User authentication based on LDAP',
  14. 'category' => 'authentication',
  15. // Setup
  16. //
  17. 'dependencies' => array(
  18. ),
  19. 'mandatory' => false,
  20. 'visible' => true,
  21. // Components
  22. //
  23. 'datamodel' => array(
  24. 'model.authent-ldap.php',
  25. ),
  26. 'data.struct' => array(
  27. //'data.struct.authent-ldap.xml',
  28. ),
  29. 'data.sample' => array(
  30. //'data.sample.authent-ldap.xml',
  31. ),
  32. // Documentation
  33. //
  34. 'doc.manual_setup' => '',
  35. 'doc.more_information' => '',
  36. // Default settings
  37. //
  38. 'settings' => array(
  39. 'host' => 'localhost', // host or IP address of your LDAP server
  40. 'port' => 389, // LDAP port (std: 389)
  41. 'default_user' => '', // User and password used for initial "Anonymous" bind to LDAP
  42. 'default_pwd' => '', // Leave both blank, if anonymous (read-only) bind is allowed
  43. 'base_dn' => 'dc=yourcompany,dc=com', // Base DN for User queries, adjust it to your LDAP schema
  44. 'user_query' => '(&(uid=%1$s)(inetuserstatus=ACTIVE))', // Query used to retrieve each user %1$s => iTop login
  45. // For Windows AD use (samaccountname=%1$s) or (userprincipalname=%1$s)
  46. // Some extra LDAP options, refer to: http://www.php.net/manual/en/function.ldap-set-option.php for more info
  47. 'options' => array(
  48. LDAP_OPT_PROTOCOL_VERSION => 3,
  49. LDAP_OPT_REFERRALS => 0,
  50. ),
  51. ),
  52. )
  53. );
  54. } // if (function_exists('ldap_connect'))
  55. ?>