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',
|
2022-05-11 07:25:33 +02:00
|
|
|
'fourthgenet.com',
|
2022-08-04 04:40:14 +02:00
|
|
|
'arxxwalls.com',
|
2022-08-19 00:41:50 +02:00
|
|
|
'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)
|
|
|
|
{
|
2022-06-21 11:57:17 +02:00
|
|
|
$parts = explode('@', $value);
|
2022-04-29 00:47:19 +02:00
|
|
|
|
2022-06-21 11:57:17 +02:00
|
|
|
if (is_array($parts)) {
|
2022-04-29 00:47:19 +02:00
|
|
|
return ! in_array($parts[1], $this->blacklist);
|
2022-06-21 11:57:17 +02:00
|
|
|
} else {
|
2022-04-29 00:47:19 +02:00
|
|
|
return true;
|
2022-06-21 11:57:17 +02:00
|
|
|
}
|
2022-04-29 00:47:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function message()
|
|
|
|
{
|
2022-06-21 11:57:17 +02:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|