From f3b6cd08f03e11704cb91da6c574b094ccb691f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20H=C3=A4rdeman?= Date: Sun, 22 Aug 2021 12:54:02 +0200 Subject: [PATCH] [ldap-contacts-suggestions] Update defaults Since multiple LDAP attributes are supported for the user name/email, there's no harm in having defaults that are a bit more flexible (for example, "givenName" is commonly only the users first name, while a full name is usually preferable as an email recipient). --- .../ldap-contacts-suggestions/LdapContactsSuggestions.php | 8 ++++---- plugins/ldap-contacts-suggestions/index.php | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/ldap-contacts-suggestions/LdapContactsSuggestions.php b/plugins/ldap-contacts-suggestions/LdapContactsSuggestions.php index 288122fde..ae891a4c5 100644 --- a/plugins/ldap-contacts-suggestions/LdapContactsSuggestions.php +++ b/plugins/ldap-contacts-suggestions/LdapContactsSuggestions.php @@ -25,7 +25,7 @@ class LdapContactsSuggestions implements \RainLoop\Providers\Suggestions\ISugges /** * @var string */ - private $sBaseDn = ''; + private $sBaseDn = 'ou=People,dc=example,dc=com'; /** * @var string @@ -40,12 +40,12 @@ class LdapContactsSuggestions implements \RainLoop\Providers\Suggestions\ISugges /** * @var string */ - private $sNameField = 'givenName'; + private $sNameField = 'displayName,cn,givenName,sn'; /** * @var string */ - private $sEmailField = 'mail'; + private $sEmailField = 'mailAddress,mail,mailAlternateAddress,mailAlias'; /** * @var \MailSo\Log\Logger @@ -55,7 +55,7 @@ class LdapContactsSuggestions implements \RainLoop\Providers\Suggestions\ISugges /** * @var string */ - private $sAllowedEmails = ''; + private $sAllowedEmails = '*'; /** * @param string $sLdapUri diff --git a/plugins/ldap-contacts-suggestions/index.php b/plugins/ldap-contacts-suggestions/index.php index 217d2971f..a36b2a47b 100644 --- a/plugins/ldap-contacts-suggestions/index.php +++ b/plugins/ldap-contacts-suggestions/index.php @@ -86,7 +86,7 @@ class LdapContactsSuggestionsPlugin extends \RainLoop\Plugins\AbstractPlugin ->SetDefaultValue(''), \RainLoop\Plugins\Property::NewInstance('base_dn')->SetLabel('Search base DN') ->SetDescription('DN to use as the search base. Supported tokens: {domain}, {domain:dc}, {email}, {email:user}, {email:domain}, {login}, {imap:login}, {imap:host}, {imap:port}') - ->SetDefaultValue('ou=People,dc=domain,dc=com'), + ->SetDefaultValue('ou=People,dc=example,dc=com'), \RainLoop\Plugins\Property::NewInstance('object_class')->SetLabel('objectClass value') ->SetDefaultValue('inetOrgPerson'), \RainLoop\Plugins\Property::NewInstance('uid_field')->SetLabel('uid attributes') @@ -94,10 +94,10 @@ class LdapContactsSuggestionsPlugin extends \RainLoop\Plugins\AbstractPlugin ->SetDefaultValue('uid'), \RainLoop\Plugins\Property::NewInstance('name_field')->SetLabel('Name attributes') ->SetDescription('LDAP attributes for user names, comma separated list in order of preference') - ->SetDefaultValue('givenName'), + ->SetDefaultValue('displayName,cn,givenName,sn'), \RainLoop\Plugins\Property::NewInstance('mail_field')->SetLabel('Mail attributes') ->SetDescription('LDAP attributes for user email addresses, comma separated list in order of preference') - ->SetDefaultValue('mail'), + ->SetDefaultValue('mailAddress,mail,mailAlternateAddress,mailAlias'), \RainLoop\Plugins\Property::NewInstance('allowed_emails')->SetLabel('Allowed emails') ->SetDescription('Email addresses of users which should be allowed to do LDAP lookups, space as delimiter, wildcard supported. Example: user1@domain1.net user2@domain1.net *@domain2.net') ->SetDefaultValue('*')