mirror of https://github.com/pixelfed/pixelfed
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1015 B
PHTML
51 lines
1015 B
PHTML
|
7 years ago
|
<?php
|
||
|
|
|
||
|
4 weeks ago
|
namespace App\Console\Commands\Admin;
|
||
|
7 years ago
|
|
||
|
4 weeks ago
|
use App\Models\User;
|
||
|
7 years ago
|
use App\Services\EmailService;
|
||
|
9 months ago
|
use Illuminate\Console\Command;
|
||
|
7 years ago
|
|
||
|
|
class BannedEmailCheck extends Command
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* The name and signature of the console command.
|
||
|
|
*
|
||
|
|
* @var string
|
||
|
|
*/
|
||
|
|
protected $signature = 'email:bancheck';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* The console command description.
|
||
|
|
*
|
||
|
|
* @var string
|
||
|
|
*/
|
||
|
|
protected $description = 'Checks user emails for banned domains';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Create a new command instance.
|
||
|
|
*
|
||
|
|
* @return void
|
||
|
|
*/
|
||
|
|
public function __construct()
|
||
|
|
{
|
||
|
|
parent::__construct();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Execute the console command.
|
||
|
|
*
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function handle()
|
||
|
|
{
|
||
|
9 months ago
|
$users = User::whereNull('status')->get()->filter(function ($u) {
|
||
|
7 years ago
|
return EmailService::isBanned($u->email) == true;
|
||
|
|
});
|
||
|
|
|
||
|
9 months ago
|
foreach ($users as $user) {
|
||
|
|
$this->info('Found banned domain: '.$user->email.PHP_EOL);
|
||
|
7 years ago
|
}
|
||
|
|
}
|
||
|
|
}
|