From d3b51715dcbf3f0a20452012c299c4146c3fe80c Mon Sep 17 00:00:00 2001 From: Kasey Date: Fri, 20 Oct 2017 17:21:21 -0700 Subject: [PATCH] adding --force to `php artistan snipeit:legacy-recrypt` (#4232) --- app/Console/Commands/RecryptFromMcrypt.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/RecryptFromMcrypt.php b/app/Console/Commands/RecryptFromMcrypt.php index bb38f098f..f9b39183a 100644 --- a/app/Console/Commands/RecryptFromMcrypt.php +++ b/app/Console/Commands/RecryptFromMcrypt.php @@ -16,7 +16,8 @@ class RecryptFromMcrypt extends Command * * @var string */ - protected $signature = 'snipeit:legacy-recrypt'; + protected $signature = 'snipeit:legacy-recrypt + {--force : Force a re-crypt of encrypted data from MCRYPT.}'; /** * The console command description. @@ -81,7 +82,9 @@ class RecryptFromMcrypt extends Command $this->error('================================!!!! WARNING !!!!================================'); $this->comment("This tool will attempt to decrypt your old Snipe-IT (mcrypt, now deprecated) encrypted data and re-encrypt it using OpenSSL. \n\nYou should only continue if you have backed up any and all old APP_KEYs and have backed up your data."); - if ($this->confirm("Are you SURE you wish to continue?")) { + $force = ($this->option('force')) ? true : false; + + if ($force || ($this->confirm("Are you SURE you wish to continue?"))) { $backup_file = 'backups/env-backups/'.'app_key-'.date('Y-m-d-gis');