mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 16:07:03 +03:00
Simple black list plugin fix
This commit is contained in:
parent
7f16fa87a3
commit
e95a3c1f95
1 changed files with 4 additions and 4 deletions
|
|
@ -16,11 +16,11 @@ class BlackListPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
*/
|
*/
|
||||||
public function FilterLoginCredentials(&$sEmail, &$sLogin, &$sPassword)
|
public function FilterLoginCredentials(&$sEmail, &$sLogin, &$sPassword)
|
||||||
{
|
{
|
||||||
if (\RainLoop\Plugins\Helper::ValidateWildcardValues($sEmail,
|
$sBlackList = \trim($this->Config()->Get('plugin', 'black_list', ''));
|
||||||
$this->Config()->Get('plugin', 'black_list', '')))
|
if (0 < \strlen($sBlackList) && \RainLoop\Plugins\Helper::ValidateWildcardValues($sEmail, $sBlackList))
|
||||||
{
|
{
|
||||||
$sExceptions = \trim($this->Config()->Get('plugin', 'exceptions', ''));
|
$sExceptions = \trim($this->Config()->Get('plugin', 'exceptions', ''));
|
||||||
if (0 === strlen($sExceptions) || !\RainLoop\Plugins\Helper::ValidateWildcardValues($sEmail, $sExceptions))
|
if (0 === \strlen($sExceptions) || !\RainLoop\Plugins\Helper::ValidateWildcardValues($sEmail, $sExceptions))
|
||||||
{
|
{
|
||||||
throw new \RainLoop\Exceptions\ClientException(
|
throw new \RainLoop\Exceptions\ClientException(
|
||||||
$this->Config()->Get('plugin', 'auth_error', true) ?
|
$this->Config()->Get('plugin', 'auth_error', true) ?
|
||||||
|
|
@ -46,7 +46,7 @@ class BlackListPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
\RainLoop\Plugins\Property::NewInstance('exceptions')->SetLabel('Exceptions')
|
\RainLoop\Plugins\Property::NewInstance('exceptions')->SetLabel('Exceptions')
|
||||||
->SetType(\RainLoop\Enumerations\PluginPropertyType::STRING_TEXT)
|
->SetType(\RainLoop\Enumerations\PluginPropertyType::STRING_TEXT)
|
||||||
->SetDescription('Exceptions for black list, space as delimiter, wildcard supported.')
|
->SetDescription('Exceptions for black list, space as delimiter, wildcard supported.')
|
||||||
->SetDefaultValue('demo@domain1.com test-*@domain2.com admin@*')
|
->SetDefaultValue('demo@domain1.com *@domain2.com admin@*')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue