/samples/roundcubemail/global_ldap_address_book.inc.php

https://github.com/iredmail/iRedMail · PHP · 58 lines · 50 code · 5 blank · 3 comment · 0 complexity · 9868571ccb110c663340b6ed51bbb8aa MD5 · raw file

  1. // Global LDAP address book.
  2. $config['ldap_public']["global_ldap_abook"] = array(
  3. 'name' => 'Global LDAP Address Book',
  4. 'hosts' => array('PH_LDAP_SERVER_HOST'),
  5. 'port' => PH_LDAP_SERVER_PORT,
  6. 'use_tls' => false,
  7. 'ldap_version' => '3',
  8. 'network_timeout' => 10,
  9. 'user_specific' => true,
  10. // Search mail users under same domain.
  11. 'base_dn' => 'domainName=%d,PH_LDAP_BASEDN',
  12. 'bind_dn' => 'mail=%u@%d,ou=Users,domainName=%d,PH_LDAP_BASEDN',
  13. 'hidden' => false,
  14. 'searchonly' => false,
  15. 'writable' => false,
  16. 'search_fields' => array('mail', 'cn', 'sn', 'givenName', 'street', 'telephoneNumber', 'mobile', 'stree', 'postalCode'),
  17. // mapping of contact fields to directory attributes
  18. 'fieldmap' => array(
  19. 'name' => 'cn',
  20. 'surname' => 'sn',
  21. 'firstname' => 'givenName',
  22. 'title' => 'title',
  23. 'email' => 'mail:*',
  24. 'phone:work' => 'telephoneNumber',
  25. 'phone:mobile' => 'mobile',
  26. 'phone:workfax' => 'facsimileTelephoneNumber',
  27. 'street' => 'street',
  28. 'zipcode' => 'postalCode',
  29. 'locality' => 'l',
  30. 'department' => 'departmentNumber',
  31. 'notes' => 'description',
  32. 'photo' => 'jpegPhoto',
  33. ),
  34. 'sort' => 'cn',
  35. 'scope' => 'sub',
  36. 'filter' => '(&(enabledService=mail)(enabledService=deliver)(enabledService=displayedInGlobalAddressBook)(|(objectClass=mailUser)(objectClass=mailList)(objectClass=mailAlias)))',
  37. 'fuzzy_search' => true,
  38. 'vlv' => false, // Enable Virtual List View to more efficiently fetch paginated data (if server supports it)
  39. 'sizelimit' => '0', // Enables you to limit the count of entries fetched. Setting this to 0 means no limit.
  40. 'timelimit' => '0', // Sets the number of seconds how long is spend on the search. Setting this to 0 means no limit.
  41. 'referrals' => false, // Sets the LDAP_OPT_REFERRALS option. Mostly used in multi-domain Active Directory setups
  42. 'group_filters' => array(
  43. 'departments' => array(
  44. 'name' => 'Mailing Lists',
  45. 'scope' => 'sub',
  46. 'base_dn' => 'domainName=%d,PH_LDAP_BASEDN',
  47. 'filter' => '(&(|(objectclass=mailList)(objectClass=mailAlias))(accountStatus=active)(enabledService=displayedInGlobalAddressBook))',
  48. 'name_attr' => 'cn',
  49. 'email' => 'mail',
  50. ),
  51. ),
  52. );
  53. $config['autocomplete_addressbooks'] = array('sql', 'global_ldap_abook');