Added giant warning message if you attempt to change an encryption key once one has been set.
This commit is contained in:
parent
80994dc12e
commit
21cd0688e0
3 changed files with 34 additions and 0 deletions
28
app/Console/Commands/Overrides/KeyGenerateCommand.php
Normal file
28
app/Console/Commands/Overrides/KeyGenerateCommand.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Overrides;
|
||||
|
||||
use Illuminate\Foundation\Console\KeyGenerateCommand as BaseKeyGenerateCommand;
|
||||
|
||||
class KeyGenerateCommand extends BaseKeyGenerateCommand
|
||||
{
|
||||
/**
|
||||
* Override the default Laravel key generation command to throw a warning to the user
|
||||
* if it appears that they have already generated an application encryption key.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
if (! empty(config('app.key')) && $this->input->isInteractive()) {
|
||||
$this->output->warning(trans('command/messages.key.warning'));
|
||||
if (! $this->confirm(trans('command/messages.key.confirm'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (! $this->confirm(trans('command/messages.key.final_confirm'))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
parent::handle();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue