From c23eeb54be298793aba5ebb7c304c9fa63f2efe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20H=C3=A4rdeman?= Date: Sun, 22 Aug 2021 00:42:38 +0200 Subject: [PATCH] [ldap-contacts-suggestions] Fix allowed emails The configuration interface allows a list of allowed emails to be set, but the configuration parameter is never used. --- .../LdapContactsSuggestions.php | 14 ++------------ plugins/ldap-contacts-suggestions/index.php | 3 ++- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/plugins/ldap-contacts-suggestions/LdapContactsSuggestions.php b/plugins/ldap-contacts-suggestions/LdapContactsSuggestions.php index 9e8a45982..8f69d425d 100644 --- a/plugins/ldap-contacts-suggestions/LdapContactsSuggestions.php +++ b/plugins/ldap-contacts-suggestions/LdapContactsSuggestions.php @@ -66,10 +66,11 @@ class LdapContactsSuggestions implements \RainLoop\Providers\Suggestions\ISugges * @param string $sObjectClass * @param string $sNameField * @param string $sEmailField + * @param string $sAllowedEmails * * @return \LdapContactsSuggestions */ - public function SetConfig($sHostName, $iHostPort, $sAccessDn, $sAccessPassword, $sUsersDn, $sObjectClass, $sUidField, $sNameField, $sEmailField) + public function SetConfig($sHostName, $iHostPort, $sAccessDn, $sAccessPassword, $sUsersDn, $sObjectClass, $sUidField, $sNameField, $sEmailField, $sAllowedEmails) { $this->sHostName = $sHostName; $this->iHostPort = $iHostPort; @@ -83,17 +84,6 @@ class LdapContactsSuggestions implements \RainLoop\Providers\Suggestions\ISugges $this->sUidField = $sUidField; $this->sNameField = $sNameField; $this->sEmailField = $sEmailField; - - return $this; - } - - /** - * @param string $sAllowedEmails - * - * @return \LdapContactsSuggestions - */ - public function SetAllowedEmails($sAllowedEmails) - { $this->sAllowedEmails = $sAllowedEmails; return $this; diff --git a/plugins/ldap-contacts-suggestions/index.php b/plugins/ldap-contacts-suggestions/index.php index 97aa4177b..7bc36c7c1 100644 --- a/plugins/ldap-contacts-suggestions/index.php +++ b/plugins/ldap-contacts-suggestions/index.php @@ -50,13 +50,14 @@ class LdapContactsSuggestionsPlugin extends \RainLoop\Plugins\AbstractPlugin $sSearchField = \trim($this->Config()->Get('plugin', 'search_field', '')); $sNameField = \trim($this->Config()->Get('plugin', 'name_field', '')); $sEmailField = \trim($this->Config()->Get('plugin', 'mail_field', '')); + $sAllowedEmails = \trim($this->Config()->Get('plugin', 'allowed_emails', '')); if (0 < \strlen($sUsersDn) && 0 < \strlen($sObjectClass) && 0 < \strlen($sEmailField)) { include_once __DIR__.'/LdapContactsSuggestions.php'; $oProvider = new LdapContactsSuggestions(); - $oProvider->SetConfig($sHostName, $iHostPort, $sAccessDn, $sAccessPassword, $sUsersDn, $sObjectClass, $sSearchField, $sNameField, $sEmailField); + $oProvider->SetConfig($sHostName, $iHostPort, $sAccessDn, $sAccessPassword, $sUsersDn, $sObjectClass, $sSearchField, $sNameField, $sEmailField, $sAllowedEmails); $mResult[] = $oProvider; }