1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-23 09:51:35 +02:00
invoiceninja/app/Http/ValidationRules/Account/BlackListRule.php

58 lines
1.2 KiB
PHP
Raw Normal View History

2022-04-29 00:47:19 +02:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
2023-01-28 23:21:40 +01:00
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
2022-04-29 00:47:19 +02:00
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Http\ValidationRules\Account;
use Illuminate\Contracts\Validation\Rule;
/**
* Class BlackListRule.
*/
class BlackListRule implements Rule
{
private array $blacklist = [
'candassociates.com',
2022-05-11 04:23:40 +02:00
'vusra.com',
'fourthgenet.com',
2022-08-04 04:40:14 +02:00
'arxxwalls.com',
'superhostforumla.com',
'wnpop.com',
2022-09-10 01:44:43 +02:00
'dataservices.space',
2022-11-14 21:40:32 +01:00
'karenkey.com',
2022-11-15 13:04:14 +01:00
'sharklasers.com',
2023-01-11 10:41:09 +01:00
'100072641.help'
2022-04-29 00:47:19 +02:00
];
/**
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
$parts = explode('@', $value);
2022-04-29 00:47:19 +02:00
if (is_array($parts)) {
2022-04-29 00:47:19 +02:00
return ! in_array($parts[1], $this->blacklist);
} else {
2022-04-29 00:47:19 +02:00
return true;
}
2022-04-29 00:47:19 +02:00
}
/**
* @return string
*/
public function message()
{
return 'This domain is blacklisted, if you think this is in error, please email contact@invoiceninja.com';
2022-04-29 00:47:19 +02:00
}
}