mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Exceptions configuration for black list plugin.
This commit is contained in:
parent
54a522f7e4
commit
5d5cab6afe
2 changed files with 14 additions and 6 deletions
|
|
@ -1 +1 @@
|
|||
1.0
|
||||
1.1
|
||||
|
|
@ -18,12 +18,16 @@ class BlackListPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
{
|
||||
if (\RainLoop\Plugins\Helper::ValidateWildcardValues($sEmail,
|
||||
$this->Config()->Get('plugin', 'black_list', '')))
|
||||
{
|
||||
$sExceptions = \trim($this->Config()->Get('plugin', 'exceptions', ''));
|
||||
if (0 === strlen($sExceptions) || !\RainLoop\Plugins\Helper::ValidateWildcardValues($sEmail, $sExceptions))
|
||||
{
|
||||
throw new \RainLoop\Exceptions\ClientException(
|
||||
$this->Config()->Get('plugin', 'auth_error', true) ?
|
||||
\RainLoop\Notifications::AuthError : \RainLoop\Notifications::AccountNotAllowed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
|
|
@ -37,8 +41,12 @@ class BlackListPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
->SetDefaultValue(true),
|
||||
\RainLoop\Plugins\Property::NewInstance('black_list')->SetLabel('Black List')
|
||||
->SetType(\RainLoop\Enumerations\PluginPropertyType::STRING_TEXT)
|
||||
->SetDescription('Emails black list , space as delimiter, wildcard supported.')
|
||||
->SetDefaultValue('*@domain1.com user@domain2.com')
|
||||
->SetDescription('Emails black list, space as delimiter, wildcard supported.')
|
||||
->SetDefaultValue('*@domain1.com user@domain2.com'),
|
||||
\RainLoop\Plugins\Property::NewInstance('exceptions')->SetLabel('Exceptions')
|
||||
->SetType(\RainLoop\Enumerations\PluginPropertyType::STRING_TEXT)
|
||||
->SetDescription('Exceptions for black list, space as delimiter, wildcard supported.')
|
||||
->SetDefaultValue('demo@domain1.com test-*@domain2.com admin@*')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue