mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-18 11:03:17 +00:00
Merge pull request #5380 from pixelfed/staging
Update UserVerifyEmail command
This commit is contained in:
commit
772d8d3862
1 changed files with 9 additions and 2 deletions
|
@ -5,8 +5,9 @@ namespace App\Console\Commands;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use App\User;
|
use App\User;
|
||||||
|
use Illuminate\Contracts\Console\PromptsForMissingInput;
|
||||||
|
|
||||||
class UserVerifyEmail extends Command
|
class UserVerifyEmail extends Command implements PromptsForMissingInput
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The name and signature of the console command.
|
* The name and signature of the console command.
|
||||||
|
@ -39,13 +40,19 @@ class UserVerifyEmail extends Command
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$user = User::whereUsername($this->argument('username'))->first();
|
$username = $this->argument('username');
|
||||||
|
$user = User::whereUsername($username)->first();
|
||||||
|
|
||||||
if(!$user) {
|
if(!$user) {
|
||||||
$this->error('Username not found');
|
$this->error('Username not found');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($user->email_verified_at) {
|
||||||
|
$this->error('Email already verified ' . $user->email_verified_at->diffForHumans());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$user->email_verified_at = now();
|
$user->email_verified_at = now();
|
||||||
$user->save();
|
$user->save();
|
||||||
$this->info('Successfully verified email address for ' . $user->username);
|
$this->info('Successfully verified email address for ' . $user->username);
|
||||||
|
|
Loading…
Reference in a new issue