Parcourir la source

Merge pull request #1583 from pixelfed/frontend-ui-refactor

Update command
daniel il y a 6 ans
Parent
commit
504b198935
2 fichiers modifiés avec 50 ajouts et 0 suppressions
  1. 50 0
      app/Console/Commands/BannedEmailCheck.php
  2. 0 0
      app/Services/EmailService.php

+ 50 - 0
app/Console/Commands/BannedEmailCheck.php

@@ -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);
+        }
+    }
+}

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
app/Services/EmailService.php


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff