diff --git a/conf/backend/config-searchldap.php b/conf/backend/config-searchldap.php new file mode 100644 index 0000000..a0d36b6 --- /dev/null +++ b/conf/backend/config-searchldap.php @@ -0,0 +1,56 @@ +. +* +* Consult LICENSE file for details +************************************************/ + +// LDAP host and port +define("LDAP_HOST", "ldap://127.0.0.1/"); +define("LDAP_PORT", "389"); + +// Set USER and PASSWORD if not using anonymous bind +define("ANONYMOUS_BIND", true); +define("LDAP_BIND_USER", "cn=searchuser,dc=test,dc=net"); +define("LDAP_BIND_PASSWORD", ""); + +// Search base & filter +// the SEARCHVALUE string is substituded by the value inserted into the search field +define("LDAP_SEARCH_BASE", "ou=users,dc=yunohost,dc=org"); +define("LDAP_SEARCH_FILTER", "(|(cn=*SEARCHVALUE*)(mail=*SEARCHVALUE*))"); + +// LDAP field mapping. +// values correspond to an inetOrgPerson class +global $ldap_field_map; +$ldap_field_map = array( + SYNC_GAL_DISPLAYNAME => 'cn', + SYNC_GAL_PHONE => 'telephonenumber', + SYNC_GAL_OFFICE => '', + SYNC_GAL_TITLE => 'title', + SYNC_GAL_COMPANY => 'ou', + SYNC_GAL_ALIAS => 'uid', + SYNC_GAL_FIRSTNAME => 'givenname', + SYNC_GAL_LASTNAME => 'sn', + SYNC_GAL_HOMEPHONE => 'homephone', + SYNC_GAL_MOBILEPHONE => 'mobile', + SYNC_GAL_EMAILADDRESS => 'mail', + ); diff --git a/conf/config.php b/conf/config.php index 76a5e6f..47bb77e 100644 --- a/conf/config.php +++ b/conf/config.php @@ -276,7 +276,7 @@ * If set, the Search Provider will always be preferred. * Use 'BackendSearchLDAP' to search in a LDAP directory (see backend/searchldap/config.php) */ - define('SEARCH_PROVIDER', ''); + define('SEARCH_PROVIDER', 'BackendSearchLDAP'); // Time in seconds for the server search. Setting it too high might result in timeout. // Setting it too low might not return all results. Default is 10. define('SEARCH_WAIT', 10); diff --git a/scripts/install b/scripts/install index 14f44ce..00af287 100755 --- a/scripts/install +++ b/scripts/install @@ -189,6 +189,7 @@ fi # Copy config cp ../conf/config.php $final_path/config.php cp ../conf/backend/config-autodiscover.php $final_path/autodiscover/config.php +cp ../conf/backend/config-searchldap.php $final_path/backend/searchldap/config.php #Copy XMLElement.php ln -s /usr/share/awl/inc/XML* /var/www/$app/include/