module.authent-ldap.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. 'dictionary' => array(
  27. 'en.dict.authent-ldap.php',
  28. 'fr.dict.authent-ldap.php',
  29. 'de.dict.authent-ldap.php',
  30. 'ru.dict.authent-ldap.php',
  31. ),
  32. 'data.struct' => array(
  33. //'data.struct.authent-ldap.xml',
  34. ),
  35. 'data.sample' => array(
  36. //'data.sample.authent-ldap.xml',
  37. ),
  38. // Documentation
  39. //
  40. 'doc.manual_setup' => '',
  41. 'doc.more_information' => '',
  42. // Default settings
  43. //
  44. 'settings' => array(
  45. 'host' => 'localhost', // host or IP address of your LDAP server
  46. 'port' => 389, // LDAP port (std: 389)
  47. 'default_user' => '', // User and password used for initial "Anonymous" bind to LDAP
  48. 'default_pwd' => '', // Leave both blank, if anonymous (read-only) bind is allowed
  49. 'base_dn' => 'dc=yourcompany,dc=com', // Base DN for User queries, adjust it to your LDAP schema
  50. 'user_query' => '(&(uid=%1$s)(inetuserstatus=ACTIVE))', // Query used to retrieve each user %1$s => iTop login
  51. // For Windows AD use (samaccountname=%1$s) or (userprincipalname=%1$s)
  52. // Some extra LDAP options, refer to: http://www.php.net/manual/en/function.ldap-set-option.php for more info
  53. 'options' => array(
  54. LDAP_OPT_PROTOCOL_VERSION => 3,
  55. LDAP_OPT_REFERRALS => 0,
  56. ),
  57. ),
  58. )
  59. );
  60. } // if (function_exists('ldap_connect'))
  61. ?>