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