module.authent-ldap.php 2.0 KB

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