mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 05:44:32 -04:00
Added warning for Mcrypt
This commit is contained in:
parent
9a4af6c889
commit
60f711ec8b
@ -70,7 +70,8 @@ class UpdateKey extends Command
|
|||||||
$key = str_random(32);
|
$key = str_random(32);
|
||||||
}
|
}
|
||||||
|
|
||||||
$crypt = new Encrypter($key, config('app.cipher'));
|
$cipher = $legacy ? 'AES-256-CBC' : config('app.cipher');
|
||||||
|
$crypt = new Encrypter($key, $cipher);
|
||||||
|
|
||||||
// update values using the new key/encrypter
|
// update values using the new key/encrypter
|
||||||
foreach (AccountGateway::all() as $gateway) {
|
foreach (AccountGateway::all() as $gateway) {
|
||||||
@ -85,11 +86,21 @@ class UpdateKey extends Command
|
|||||||
$bank->save();
|
$bank->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$message = date('r') . ' Successfully updated ';
|
||||||
if ($envWriteable) {
|
if ($envWriteable) {
|
||||||
$this->info(date('r') . ' Successfully update the key');
|
if ($legacy) {
|
||||||
|
$message .= 'the key, set the cipher in the .env file to AES-256-CBC';
|
||||||
} else {
|
} else {
|
||||||
$this->info(date('r') . ' Successfully update data, make sure to set the new app key: ' . $key);
|
$message .= 'the key';
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if ($legacy) {
|
||||||
|
$message .= 'the data, make sure to set the new cipher/key: AES-256-CBC/' . $key;
|
||||||
|
} else {
|
||||||
|
$message .= 'the data, make sure to set the new key: ' . $key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->info($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -101,6 +101,8 @@ class HandleUserLoggedIn
|
|||||||
// warn if using the default app key
|
// warn if using the default app key
|
||||||
if (in_array(config('app.key'), ['SomeRandomString', 'SomeRandomStringSomeRandomString', 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'])) {
|
if (in_array(config('app.key'), ['SomeRandomString', 'SomeRandomStringSomeRandomString', 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'])) {
|
||||||
Session::flash('error', trans('texts.error_app_key_set_to_default'));
|
Session::flash('error', trans('texts.error_app_key_set_to_default'));
|
||||||
|
} elseif (in_array($appCipher, ['MCRYPT_RIJNDAEL_256', 'MCRYPT_RIJNDAEL_128'])) {
|
||||||
|
Session::flash('error', trans('texts.mcrypt_warning'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2602,6 +2602,7 @@ $LANG = array(
|
|||||||
'unable_to_delete_primary' => 'Note: to delete this company first delete all linked companies.',
|
'unable_to_delete_primary' => 'Note: to delete this company first delete all linked companies.',
|
||||||
'please_register' => 'Please register your account',
|
'please_register' => 'Please register your account',
|
||||||
'processing_request' => 'Processing request',
|
'processing_request' => 'Processing request',
|
||||||
|
'mcrypt_warning' => 'Warning: Mcrypt is deprecated, run <code>php artisan ninja:update-key --legacy=true</code> to update your cipher.',
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user