mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update command
This commit is contained in:
parent
b885cccd6b
commit
ae234b9846
2 changed files with 51 additions and 1 deletions
50
app/Console/Commands/BannedEmailCheck.php
Normal file
50
app/Console/Commands/BannedEmailCheck.php
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use App\User;
|
||||||
|
use App\Services\EmailService;
|
||||||
|
|
||||||
|
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()
|
||||||
|
{
|
||||||
|
$users = User::whereNull('status')->get()->filter(function($u) {
|
||||||
|
return EmailService::isBanned($u->email) == true;
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach($users as $user) {
|
||||||
|
$this->info('Found banned domain: ' . $user->email . PHP_EOL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue