Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Allow mfa_recovery to get a default value
Sander Dorigo1fcc86c44a9a
diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.phpindex b72a459b1a..e3f4c19405 100644--- a/app/Http/Controllers/ProfileController.php+++ b/app/Http/Controllers/ProfileController.php@@ -197,7 +197,7 @@ final class ProfileController extends Controller$subTitle = $user->email;$userId = $user->id;$enabled2FA = null !== $user->mfa_secret;- $recoveryData = Preferences::get('mfa_recovery', [])->data;+ $recoveryData = Preferences::get('mfa_recovery', [], true)->data;if (!is_array($recoveryData)) {$recoveryData = [];}diff --git a/app/Support/Preferences.php b/app/Support/Preferences.phpindex 00239f9e25..a771bfcb85 100644--- a/app/Support/Preferences.php+++ b/app/Support/Preferences.php@@ -116,7 +116,7 @@ class PreferencesCache::put($key, '', 5);}- public function get(string $name, array|bool|int|string|null $default = null): ?Preference+ public function get(string $name, array|bool|int|string|null $default = null, bool $overrule = false): ?Preference{/** @var null|User $user */$user = auth()->user();@@ -127,7 +127,7 @@ class Preferencesreturn $preference;}- return $this->getForUser($user, $name, $default);+ return $this->getForUser($user, $name, $default, $overrule);}public function getArrayForUser(User $user, array $list): array@@ -207,7 +207,7 @@ class Preferencesreturn $result;}- public function getForUser(User $user, string $name, array|bool|int|string|null $default = null): ?Preference+ public function getForUser(User $user, string $name, array|bool|int|string|null $default = null, bool $overrule = false): ?Preference{// Log::debug(sprintf('getForUser(#%d, "%s")', $user->id, $name));// don't care about user group ID, except for some specific preferences.@@ -239,7 +239,7 @@ class Preferencesreturn null;}- return $this->setForUser($user, $name, $default);+ return $this->setForUser($user, $name, $default, $overrule);}public function getFresh(string $name, array|bool|int|string|null $default = null): ?Preference