module.authent-ldap.php 2.0 KB

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