Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace BookStack\Console\Commands; use Exception; use Illuminate\Console\Comman..
Decoded Output download
<?php
namespace BookStack\Console\Commands;
use Exception;
use Illuminate\Console\Command;
class ResetMfaCommand extends Command
{
use HandlesSingleUser;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'bookstack:reset-mfa
{--id= : Numeric ID of the user to reset MFA for}
{--email= : Email address of the user to reset MFA for}
';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Reset & Clear any configured MFA methods for the given user';
/**
* Execute the console command.
*/
public function handle(): int
{
try {
$user = $this->fetchProvidedUser();
} catch (Exception $exception) {
$this->error($exception->getMessage());
return 1;
}
$this->info("This will delete any configure multi-factor authentication methods for user:
- ID: {$user->id}
- Name: {$user->name}
- Email: {$user->email}
");
$this->info('If multi-factor authentication is required for this user they will be asked to reconfigure their methods on next login.');
$confirm = $this->confirm('Are you sure you want to proceed?');
if (!$confirm) {
return 1;
}
$user->mfaValues()->delete();
$this->info('User MFA methods have been reset.');
return 0;
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace BookStack\Console\Commands;
use Exception;
use Illuminate\Console\Command;
class ResetMfaCommand extends Command
{
use HandlesSingleUser;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'bookstack:reset-mfa
{--id= : Numeric ID of the user to reset MFA for}
{--email= : Email address of the user to reset MFA for}
';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Reset & Clear any configured MFA methods for the given user';
/**
* Execute the console command.
*/
public function handle(): int
{
try {
$user = $this->fetchProvidedUser();
} catch (Exception $exception) {
$this->error($exception->getMessage());
return 1;
}
$this->info("This will delete any configure multi-factor authentication methods for user: \n- ID: {$user->id}\n- Name: {$user->name}\n- Email: {$user->email}\n");
$this->info('If multi-factor authentication is required for this user they will be asked to reconfigure their methods on next login.');
$confirm = $this->confirm('Are you sure you want to proceed?');
if (!$confirm) {
return 1;
}
$user->mfaValues()->delete();
$this->info('User MFA methods have been reset.');
return 0;
}
}
Function Calls
None |
Stats
MD5 | 386e34378119ec175370f438f82e45a1 |
Eval Count | 0 |
Decode Time | 96 ms |