Compare commits

...

8 Commits

Author SHA1 Message Date
github-actions[bot]
2bee3d2728 Merge pull request #11301 from firefly-iii/develop
🤖 Automatically merge the PR into the main branch.
2025-11-28 21:36:11 +01:00
github-actions[bot]
73126786b0 Merge pull request #11300 from firefly-iii/release-1764362158
🤖 Automatically merge the PR into the develop branch.
2025-11-28 21:36:05 +01:00
JC5
962a729025 🤖 Auto commit for release 'v6.4.9' on 2025-11-28 2025-11-28 21:35:58 +01:00
github-actions[bot]
f262cb3947 Merge pull request #11298 from firefly-iii/release-1764353294
🤖 Automatically merge the PR into the develop branch.
2025-11-28 19:08:24 +01:00
JC5
212d579c4f 🤖 Auto commit for release 'develop' on 2025-11-28 2025-11-28 19:08:14 +01:00
James Cole
30937610eb Update changelog. 2025-11-28 19:02:50 +01:00
James Cole
3558bf7647 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2025-11-28 19:01:21 +01:00
James Cole
3711222f9e Fix #11281 and some other stuff. 2025-11-28 19:01:15 +01:00
92 changed files with 686 additions and 572 deletions

View File

@@ -1251,47 +1251,39 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v7.3.6", "version": "v8.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "c28ad91448f86c5f6d9d2c70f0cf68bf135f252a" "reference": "307d3cf852f5ead3618ac60ecbedbdd512c348b1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/c28ad91448f86c5f6d9d2c70f0cf68bf135f252a", "url": "https://api.github.com/repos/symfony/console/zipball/307d3cf852f5ead3618ac60ecbedbdd512c348b1",
"reference": "c28ad91448f86c5f6d9d2c70f0cf68bf135f252a", "reference": "307d3cf852f5ead3618ac60ecbedbdd512c348b1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.2", "php": ">=8.4",
"symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "^1.0",
"symfony/polyfill-mbstring": "~1.0",
"symfony/service-contracts": "^2.5|^3", "symfony/service-contracts": "^2.5|^3",
"symfony/string": "^7.2" "symfony/string": "^7.4|^8.0"
},
"conflict": {
"symfony/dependency-injection": "<6.4",
"symfony/dotenv": "<6.4",
"symfony/event-dispatcher": "<6.4",
"symfony/lock": "<6.4",
"symfony/process": "<6.4"
}, },
"provide": { "provide": {
"psr/log-implementation": "1.0|2.0|3.0" "psr/log-implementation": "1.0|2.0|3.0"
}, },
"require-dev": { "require-dev": {
"psr/log": "^1|^2|^3", "psr/log": "^1|^2|^3",
"symfony/config": "^6.4|^7.0", "symfony/config": "^7.4|^8.0",
"symfony/dependency-injection": "^6.4|^7.0", "symfony/dependency-injection": "^7.4|^8.0",
"symfony/event-dispatcher": "^6.4|^7.0", "symfony/event-dispatcher": "^7.4|^8.0",
"symfony/http-foundation": "^6.4|^7.0", "symfony/http-foundation": "^7.4|^8.0",
"symfony/http-kernel": "^6.4|^7.0", "symfony/http-kernel": "^7.4|^8.0",
"symfony/lock": "^6.4|^7.0", "symfony/lock": "^7.4|^8.0",
"symfony/messenger": "^6.4|^7.0", "symfony/messenger": "^7.4|^8.0",
"symfony/process": "^6.4|^7.0", "symfony/process": "^7.4|^8.0",
"symfony/stopwatch": "^6.4|^7.0", "symfony/stopwatch": "^7.4|^8.0",
"symfony/var-dumper": "^6.4|^7.0" "symfony/var-dumper": "^7.4|^8.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -1325,7 +1317,7 @@
"terminal" "terminal"
], ],
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v7.3.6" "source": "https://github.com/symfony/console/tree/v8.0.0"
}, },
"funding": [ "funding": [
{ {
@@ -1345,7 +1337,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-11-04T01:21:42+00:00" "time": "2025-11-21T13:19:49+00:00"
}, },
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
@@ -1416,24 +1408,24 @@
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
"version": "v7.3.3", "version": "v8.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/event-dispatcher.git", "url": "https://github.com/symfony/event-dispatcher.git",
"reference": "b7dc69e71de420ac04bc9ab830cf3ffebba48191" "reference": "573f95783a2ec6e38752979db139f09fec033f03"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b7dc69e71de420ac04bc9ab830cf3ffebba48191", "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/573f95783a2ec6e38752979db139f09fec033f03",
"reference": "b7dc69e71de420ac04bc9ab830cf3ffebba48191", "reference": "573f95783a2ec6e38752979db139f09fec033f03",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.2", "php": ">=8.4",
"symfony/event-dispatcher-contracts": "^2.5|^3" "symfony/event-dispatcher-contracts": "^2.5|^3"
}, },
"conflict": { "conflict": {
"symfony/dependency-injection": "<6.4", "symfony/security-http": "<7.4",
"symfony/service-contracts": "<2.5" "symfony/service-contracts": "<2.5"
}, },
"provide": { "provide": {
@@ -1442,13 +1434,14 @@
}, },
"require-dev": { "require-dev": {
"psr/log": "^1|^2|^3", "psr/log": "^1|^2|^3",
"symfony/config": "^6.4|^7.0", "symfony/config": "^7.4|^8.0",
"symfony/dependency-injection": "^6.4|^7.0", "symfony/dependency-injection": "^7.4|^8.0",
"symfony/error-handler": "^6.4|^7.0", "symfony/error-handler": "^7.4|^8.0",
"symfony/expression-language": "^6.4|^7.0", "symfony/expression-language": "^7.4|^8.0",
"symfony/http-foundation": "^6.4|^7.0", "symfony/framework-bundle": "^7.4|^8.0",
"symfony/http-foundation": "^7.4|^8.0",
"symfony/service-contracts": "^2.5|^3", "symfony/service-contracts": "^2.5|^3",
"symfony/stopwatch": "^6.4|^7.0" "symfony/stopwatch": "^7.4|^8.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -1476,7 +1469,7 @@
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/event-dispatcher/tree/v7.3.3" "source": "https://github.com/symfony/event-dispatcher/tree/v8.0.0"
}, },
"funding": [ "funding": [
{ {
@@ -1496,7 +1489,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-08-13T11:49:31+00:00" "time": "2025-10-30T14:17:19+00:00"
}, },
{ {
"name": "symfony/event-dispatcher-contracts", "name": "symfony/event-dispatcher-contracts",
@@ -1576,25 +1569,25 @@
}, },
{ {
"name": "symfony/filesystem", "name": "symfony/filesystem",
"version": "v7.3.6", "version": "v8.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/filesystem.git", "url": "https://github.com/symfony/filesystem.git",
"reference": "e9bcfd7837928ab656276fe00464092cc9e1826a" "reference": "7fc96ae83372620eaba3826874f46e26295768ca"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/e9bcfd7837928ab656276fe00464092cc9e1826a", "url": "https://api.github.com/repos/symfony/filesystem/zipball/7fc96ae83372620eaba3826874f46e26295768ca",
"reference": "e9bcfd7837928ab656276fe00464092cc9e1826a", "reference": "7fc96ae83372620eaba3826874f46e26295768ca",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.2", "php": ">=8.4",
"symfony/polyfill-ctype": "~1.8", "symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-mbstring": "~1.8" "symfony/polyfill-mbstring": "~1.8"
}, },
"require-dev": { "require-dev": {
"symfony/process": "^6.4|^7.0" "symfony/process": "^7.4|^8.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -1622,7 +1615,7 @@
"description": "Provides basic utilities for the filesystem", "description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/filesystem/tree/v7.3.6" "source": "https://github.com/symfony/filesystem/tree/v8.0.0"
}, },
"funding": [ "funding": [
{ {
@@ -1642,27 +1635,27 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-11-05T09:52:27+00:00" "time": "2025-11-05T14:36:47+00:00"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
"version": "v7.3.5", "version": "v8.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/finder.git", "url": "https://github.com/symfony/finder.git",
"reference": "9f696d2f1e340484b4683f7853b273abff94421f" "reference": "7598dd5770580fa3517ec83e8da0c9b9e01f4291"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/9f696d2f1e340484b4683f7853b273abff94421f", "url": "https://api.github.com/repos/symfony/finder/zipball/7598dd5770580fa3517ec83e8da0c9b9e01f4291",
"reference": "9f696d2f1e340484b4683f7853b273abff94421f", "reference": "7598dd5770580fa3517ec83e8da0c9b9e01f4291",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.2" "php": ">=8.4"
}, },
"require-dev": { "require-dev": {
"symfony/filesystem": "^6.4|^7.0" "symfony/filesystem": "^7.4|^8.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -1690,7 +1683,7 @@
"description": "Finds files and directories via an intuitive fluent interface", "description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/finder/tree/v7.3.5" "source": "https://github.com/symfony/finder/tree/v8.0.0"
}, },
"funding": [ "funding": [
{ {
@@ -1710,24 +1703,24 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-10-15T18:45:57+00:00" "time": "2025-11-05T14:36:47+00:00"
}, },
{ {
"name": "symfony/options-resolver", "name": "symfony/options-resolver",
"version": "v7.3.3", "version": "v8.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/options-resolver.git", "url": "https://github.com/symfony/options-resolver.git",
"reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d" "reference": "d2b592535ffa6600c265a3893a7f7fd2bad82dd7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/0ff2f5c3df08a395232bbc3c2eb7e84912df911d", "url": "https://api.github.com/repos/symfony/options-resolver/zipball/d2b592535ffa6600c265a3893a7f7fd2bad82dd7",
"reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d", "reference": "d2b592535ffa6600c265a3893a7f7fd2bad82dd7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.2", "php": ">=8.4",
"symfony/deprecation-contracts": "^2.5|^3" "symfony/deprecation-contracts": "^2.5|^3"
}, },
"type": "library", "type": "library",
@@ -1761,7 +1754,7 @@
"options" "options"
], ],
"support": { "support": {
"source": "https://github.com/symfony/options-resolver/tree/v7.3.3" "source": "https://github.com/symfony/options-resolver/tree/v8.0.0"
}, },
"funding": [ "funding": [
{ {
@@ -1781,7 +1774,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-08-05T10:16:07+00:00" "time": "2025-11-12T15:55:31+00:00"
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
@@ -2364,20 +2357,20 @@
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v7.3.4", "version": "v8.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
"reference": "f24f8f316367b30810810d4eb30c543d7003ff3b" "reference": "a0a750500c4ce900d69ba4e9faf16f82c10ee149"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/f24f8f316367b30810810d4eb30c543d7003ff3b", "url": "https://api.github.com/repos/symfony/process/zipball/a0a750500c4ce900d69ba4e9faf16f82c10ee149",
"reference": "f24f8f316367b30810810d4eb30c543d7003ff3b", "reference": "a0a750500c4ce900d69ba4e9faf16f82c10ee149",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.2" "php": ">=8.4"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -2405,7 +2398,7 @@
"description": "Executes commands in sub-processes", "description": "Executes commands in sub-processes",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/process/tree/v7.3.4" "source": "https://github.com/symfony/process/tree/v8.0.0"
}, },
"funding": [ "funding": [
{ {
@@ -2425,7 +2418,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-09-11T10:12:26+00:00" "time": "2025-10-16T16:25:44+00:00"
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",
@@ -2516,20 +2509,20 @@
}, },
{ {
"name": "symfony/stopwatch", "name": "symfony/stopwatch",
"version": "v7.3.0", "version": "v8.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/stopwatch.git", "url": "https://github.com/symfony/stopwatch.git",
"reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd" "reference": "67df1914c6ccd2d7b52f70d40cf2aea02159d942"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd", "url": "https://api.github.com/repos/symfony/stopwatch/zipball/67df1914c6ccd2d7b52f70d40cf2aea02159d942",
"reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd", "reference": "67df1914c6ccd2d7b52f70d40cf2aea02159d942",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.2", "php": ">=8.4",
"symfony/service-contracts": "^2.5|^3" "symfony/service-contracts": "^2.5|^3"
}, },
"type": "library", "type": "library",
@@ -2558,7 +2551,7 @@
"description": "Provides a way to profile code", "description": "Provides a way to profile code",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/stopwatch/tree/v7.3.0" "source": "https://github.com/symfony/stopwatch/tree/v8.0.0"
}, },
"funding": [ "funding": [
{ {
@@ -2569,43 +2562,47 @@
"url": "https://github.com/fabpot", "url": "https://github.com/fabpot",
"type": "github" "type": "github"
}, },
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{ {
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-02-24T10:49:57+00:00" "time": "2025-08-04T07:36:47+00:00"
}, },
{ {
"name": "symfony/string", "name": "symfony/string",
"version": "v7.3.4", "version": "v8.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/string.git", "url": "https://github.com/symfony/string.git",
"reference": "f96476035142921000338bad71e5247fbc138872" "reference": "f929eccf09531078c243df72398560e32fa4cf4f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/f96476035142921000338bad71e5247fbc138872", "url": "https://api.github.com/repos/symfony/string/zipball/f929eccf09531078c243df72398560e32fa4cf4f",
"reference": "f96476035142921000338bad71e5247fbc138872", "reference": "f929eccf09531078c243df72398560e32fa4cf4f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=8.2", "php": ">=8.4",
"symfony/polyfill-ctype": "~1.8", "symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-grapheme": "^1.33",
"symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-intl-normalizer": "^1.0",
"symfony/polyfill-mbstring": "~1.0" "symfony/polyfill-mbstring": "^1.0"
}, },
"conflict": { "conflict": {
"symfony/translation-contracts": "<2.5" "symfony/translation-contracts": "<2.5"
}, },
"require-dev": { "require-dev": {
"symfony/emoji": "^7.1", "symfony/emoji": "^7.4|^8.0",
"symfony/http-client": "^6.4|^7.0", "symfony/http-client": "^7.4|^8.0",
"symfony/intl": "^6.4|^7.0", "symfony/intl": "^7.4|^8.0",
"symfony/translation-contracts": "^2.5|^3.0", "symfony/translation-contracts": "^2.5|^3.0",
"symfony/var-exporter": "^6.4|^7.0" "symfony/var-exporter": "^7.4|^8.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -2644,7 +2641,7 @@
"utf8" "utf8"
], ],
"support": { "support": {
"source": "https://github.com/symfony/string/tree/v7.3.4" "source": "https://github.com/symfony/string/tree/v8.0.0"
}, },
"funding": [ "funding": [
{ {
@@ -2664,7 +2661,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-09-11T14:36:48+00:00" "time": "2025-09-11T14:37:55+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],

View File

@@ -53,8 +53,13 @@ class WebhookEventHandler
)->splice(0, 5) )->splice(0, 5)
; ;
Log::debug(sprintf('Found %d webhook message(s) ready to be send.', $messages->count())); Log::debug(sprintf('Found %d webhook message(s) ready to be send.', $messages->count()));
/** @var WebhookMessage $message */
foreach ($messages as $message) { foreach ($messages as $message) {
if (false === $message->sent) { if (false === $message->sent) {
// set it to "sent" right away!
$message->sent = true;
$message->save();
Log::debug(sprintf('Send message #%d', $message->id)); Log::debug(sprintf('Send message #%d', $message->id));
SendWebhookMessage::dispatch($message)->afterResponse(); SendWebhookMessage::dispatch($message)->afterResponse();
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account; namespace FireflyIII\Http\Controllers\Account;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
@@ -141,18 +142,18 @@ class CreateController extends Controller
$data = $request->getAccountData(); $data = $request->getAccountData();
$account = $this->repository->store($data); $account = $this->repository->store($data);
$request->session()->flash('success', (string) trans('firefly.stored_new_account', ['name' => $account->name])); $request->session()->flash('success', (string) trans('firefly.stored_new_account', ['name' => $account->name]));
app('preferences')->mark(); Preferences::mark();
Log::channel('audit')->info('Stored new account.', $data); Log::channel('audit')->info('Stored new account.', $data);
// update preferences if necessary: // update preferences if necessary:
$frontpage = app('preferences')->get('frontpageAccounts', [])->data; $frontpage = Preferences::get('frontpageAccounts', [])->data;
if (!is_array($frontpage)) { if (!is_array($frontpage)) {
$frontpage = []; $frontpage = [];
} }
if (AccountTypeEnum::ASSET->value === $account->accountType->type) { if (AccountTypeEnum::ASSET->value === $account->accountType->type) {
$frontpage[] = $account->id; $frontpage[] = $account->id;
app('preferences')->set('frontpageAccounts', $frontpage); Preferences::set('frontpageAccounts', $frontpage);
} }
// store attachment(s): // store attachment(s):

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account; namespace FireflyIII\Http\Controllers\Account;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Account\AccountRepositoryInterface;
@@ -101,7 +102,7 @@ class DeleteController extends Controller
$this->repository->destroy($account, $moveTo); $this->repository->destroy($account, $moveTo);
$request->session()->flash('success', (string) trans(sprintf('firefly.%s_deleted', $typeName), ['name' => $name])); $request->session()->flash('success', (string) trans(sprintf('firefly.%s_deleted', $typeName), ['name' => $name]));
app('preferences')->mark(); Preferences::mark();
return redirect($this->getPreviousUrl('accounts.delete.url')); return redirect($this->getPreviousUrl('accounts.delete.url'));
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account; namespace FireflyIII\Http\Controllers\Account;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\AccountFormRequest; use FireflyIII\Http\Requests\AccountFormRequest;
@@ -205,7 +206,7 @@ class EditController extends Controller
$redirect = redirect(route('accounts.edit', [$account->id]))->withInput(['return_to_edit' => 1]); $redirect = redirect(route('accounts.edit', [$account->id]))->withInput(['return_to_edit' => 1]);
} }
app('preferences')->mark(); Preferences::mark();
return $redirect; return $redirect;
} }

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account; namespace FireflyIII\Http\Controllers\Account;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
@@ -81,7 +82,7 @@ class IndexController extends Controller
$collection = $this->repository->getInactiveAccountsByType($types); $collection = $this->repository->getInactiveAccountsByType($types);
$total = $collection->count(); $total = $collection->count();
$page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page'); $page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$accounts = $collection->slice(($page - 1) * $pageSize, $pageSize); $accounts = $collection->slice(($page - 1) * $pageSize, $pageSize);
unset($collection); unset($collection);
@@ -153,7 +154,7 @@ class IndexController extends Controller
$collection = $this->repository->getActiveAccountsByType($types); $collection = $this->repository->getActiveAccountsByType($types);
$total = $collection->count(); $total = $collection->count();
$page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page'); $page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$accounts = $collection->slice(($page - 1) * $pageSize, $pageSize); $accounts = $collection->slice(($page - 1) * $pageSize, $pageSize);
$inactiveCount = $this->repository->getInactiveAccountsByType($types)->count(); $inactiveCount = $this->repository->getInactiveAccountsByType($types)->count();

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account; namespace FireflyIII\Http\Controllers\Account;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Support\Facades\Navigation; use FireflyIII\Support\Facades\Navigation;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Carbon\Carbon; use Carbon\Carbon;
@@ -175,7 +176,7 @@ class ReconcileController extends Controller
$result = $this->createReconciliation($account, $start, $end, $data['difference']); $result = $this->createReconciliation($account, $start, $end, $data['difference']);
} }
Log::debug('End of routine.'); Log::debug('End of routine.');
app('preferences')->mark(); Preferences::mark();
if ('' === $result) { if ('' === $result) {
session()->flash('success', (string) trans('firefly.reconciliation_stored')); session()->flash('success', (string) trans('firefly.reconciliation_stored'));
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account; namespace FireflyIII\Http\Controllers\Account;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface;
@@ -113,7 +114,7 @@ class ShowController extends Controller
$today = today(config('app.timezone')); $today = today(config('app.timezone'));
$subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $account->accountType->type)); $subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $account->accountType->type));
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$accountCurrency = $this->repository->getAccountCurrency($account); $accountCurrency = $this->repository->getAccountCurrency($account);
$currency = $accountCurrency ?? $this->primaryCurrency; $currency = $accountCurrency ?? $this->primaryCurrency;
$fStart = $start->isoFormat($this->monthAndDayFormat); $fStart = $start->isoFormat($this->monthAndDayFormat);
@@ -199,7 +200,7 @@ class ShowController extends Controller
$start = $this->repository->oldestJournalDate($account) ?? today(config('app.timezone'))->startOfMonth(); $start = $this->repository->oldestJournalDate($account) ?? today(config('app.timezone'))->startOfMonth();
$subTitleIcon = config('firefly.subIconsByIdentifier.'.$account->accountType->type); $subTitleIcon = config('firefly.subIconsByIdentifier.'.$account->accountType->type);
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$currency = $this->repository->getAccountCurrency($account) ?? $this->primaryCurrency; $currency = $this->repository->getAccountCurrency($account) ?? $this->primaryCurrency;
$subTitle = (string) trans('firefly.all_journals_for_account', ['name' => $account->name]); $subTitle = (string) trans('firefly.all_journals_for_account', ['name' => $account->name]);
$periods = new Collection(); $periods = new Collection();

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Admin; namespace FireflyIII\Http\Controllers\Admin;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Http\Middleware\IsDemoUser;
use FireflyIII\Http\Requests\ConfigurationRequest; use FireflyIII\Http\Requests\ConfigurationRequest;
@@ -95,7 +96,7 @@ class ConfigurationController extends Controller
// flash message // flash message
session()->flash('success', (string) trans('firefly.configuration_updated')); session()->flash('success', (string) trans('firefly.configuration_updated'));
app('preferences')->mark(); Preferences::mark();
return redirect()->route('settings.configuration.index'); return redirect()->route('settings.configuration.index');
} }

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Admin; namespace FireflyIII\Http\Controllers\Admin;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Http\Middleware\IsDemoUser;
use Illuminate\Contracts\View\Factory; use Illuminate\Contracts\View\Factory;
@@ -59,7 +60,7 @@ class HomeController extends Controller
$title = (string) trans('firefly.system_settings'); $title = (string) trans('firefly.system_settings');
$mainTitleIcon = 'fa-hand-spock-o'; $mainTitleIcon = 'fa-hand-spock-o';
$email = auth()->user()->email; $email = auth()->user()->email;
$pref = app('preferences')->get('remote_guard_alt_email'); $pref = Preferences::get('remote_guard_alt_email');
if (null !== $pref && is_string($pref->data)) { if (null !== $pref && is_string($pref->data)) {
$email = $pref->data; $email = $pref->data;
} }

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Admin; namespace FireflyIII\Http\Controllers\Admin;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser; use FireflyIII\Http\Middleware\IsDemoUser;
use FireflyIII\Http\Requests\LinkTypeFormRequest; use FireflyIII\Http\Requests\LinkTypeFormRequest;
@@ -125,7 +126,7 @@ class LinkController extends Controller
$this->repository->destroy($linkType, $moveTo); $this->repository->destroy($linkType, $moveTo);
$request->session()->flash('success', (string) trans('firefly.deleted_link_type', ['name' => $name])); $request->session()->flash('success', (string) trans('firefly.deleted_link_type', ['name' => $name]));
app('preferences')->mark(); Preferences::mark();
return redirect($this->getPreviousUrl('link-types.delete.url')); return redirect($this->getPreviousUrl('link-types.delete.url'));
} }
@@ -245,7 +246,7 @@ class LinkController extends Controller
Log::channel('audit')->info(sprintf('User update link type #%d.', $linkType->id), $data); Log::channel('audit')->info(sprintf('User update link type #%d.', $linkType->id), $data);
$request->session()->flash('success', (string) trans('firefly.updated_link_type', ['name' => $linkType->name])); $request->session()->flash('success', (string) trans('firefly.updated_link_type', ['name' => $linkType->name]));
app('preferences')->mark(); Preferences::mark();
$redirect = redirect($this->getPreviousUrl('link-types.edit.url')); $redirect = redirect($this->getPreviousUrl('link-types.edit.url'));
if (1 === (int) $request->get('return_to_edit')) { if (1 === (int) $request->get('return_to_edit')) {
// set value so edit routine will not overwrite URL: // set value so edit routine will not overwrite URL:

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Admin; namespace FireflyIII\Http\Controllers\Admin;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use FireflyIII\Events\Admin\InvitationCreated; use FireflyIII\Events\Admin\InvitationCreated;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
@@ -242,7 +243,7 @@ class UserController extends Controller
$this->repository->updateEmail($user, $data['email']); $this->repository->updateEmail($user, $data['email']);
session()->flash('success', (string) trans('firefly.updated_user', ['email' => $user->email])); session()->flash('success', (string) trans('firefly.updated_user', ['email' => $user->email]));
app('preferences')->mark(); Preferences::mark();
$redirect = redirect($this->getPreviousUrl('users.edit.url')); $redirect = redirect($this->getPreviousUrl('users.edit.url'));
if (1 === (int) $request->get('return_to_edit')) { if (1 === (int) $request->get('return_to_edit')) {
session()->put('users.edit.fromUpdate', true); session()->put('users.edit.fromUpdate', true);

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers; namespace FireflyIII\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Requests\AttachmentFormRequest; use FireflyIII\Http\Requests\AttachmentFormRequest;
use FireflyIII\Models\Attachment; use FireflyIII\Models\Attachment;
@@ -85,7 +86,7 @@ class AttachmentController extends Controller
$this->repository->destroy($attachment); $this->repository->destroy($attachment);
$request->session()->flash('success', (string) trans('firefly.attachment_deleted', ['name' => $name])); $request->session()->flash('success', (string) trans('firefly.attachment_deleted', ['name' => $name]));
app('preferences')->mark(); Preferences::mark();
return redirect($this->getPreviousUrl('attachments.delete.url')); return redirect($this->getPreviousUrl('attachments.delete.url'));
} }
@@ -175,7 +176,7 @@ class AttachmentController extends Controller
$this->repository->update($attachment, $data); $this->repository->update($attachment, $data);
$request->session()->flash('success', (string) trans('firefly.attachment_updated', ['name' => $attachment->filename])); $request->session()->flash('success', (string) trans('firefly.attachment_updated', ['name' => $attachment->filename]));
app('preferences')->mark(); Preferences::mark();
$redirect = redirect($this->getPreviousUrl('attachments.edit.url')); $redirect = redirect($this->getPreviousUrl('attachments.edit.url'));
if (1 === (int) $request->get('return_to_edit')) { if (1 === (int) $request->get('return_to_edit')) {

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Auth; namespace FireflyIII\Http\Controllers\Auth;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Events\Security\MFABackupFewLeft; use FireflyIII\Events\Security\MFABackupFewLeft;
use FireflyIII\Events\Security\MFABackupNoLeft; use FireflyIII\Events\Security\MFABackupNoLeft;
@@ -65,7 +66,7 @@ class TwoFactorController extends Controller
public function submitMFA(Request $request): Redirector|RedirectResponse public function submitMFA(Request $request): Redirector|RedirectResponse
{ {
/** @var array $mfaHistory */ /** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data; $mfaHistory = Preferences::get('mfa_history', [])->data;
$mfaCode = (string) $request->get('one_time_password'); $mfaCode = (string) $request->get('one_time_password');
// is in history? then refuse to use it. // is in history? then refuse to use it.
@@ -149,7 +150,7 @@ class TwoFactorController extends Controller
private function filterMFAHistory(): void private function filterMFAHistory(): void
{ {
/** @var array $mfaHistory */ /** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data; $mfaHistory = Preferences::get('mfa_history', [])->data;
$newHistory = []; $newHistory = [];
$now = Carbon::now()->getTimestamp(); $now = Carbon::now()->getTimestamp();
foreach ($mfaHistory as $entry) { foreach ($mfaHistory as $entry) {
@@ -162,20 +163,20 @@ class TwoFactorController extends Controller
]; ];
} }
} }
app('preferences')->set('mfa_history', $newHistory); Preferences::set('mfa_history', $newHistory);
} }
private function addToMFAFailureCounter(): void private function addToMFAFailureCounter(): void
{ {
$preference = (int) app('preferences')->get('mfa_failure_count', 0)->data; $preference = (int) Preferences::get('mfa_failure_count', 0)->data;
++$preference; ++$preference;
Log::channel('audit')->info(sprintf('MFA failure count is set to %d.', $preference)); Log::channel('audit')->info(sprintf('MFA failure count is set to %d.', $preference));
app('preferences')->set('mfa_failure_count', $preference); Preferences::set('mfa_failure_count', $preference);
} }
private function getMFAFailureCounter(): int private function getMFAFailureCounter(): int
{ {
$value = (int) app('preferences')->get('mfa_failure_count', 0)->data; $value = (int) Preferences::get('mfa_failure_count', 0)->data;
Log::channel('audit')->info(sprintf('MFA failure count is %d.', $value)); Log::channel('audit')->info(sprintf('MFA failure count is %d.', $value));
return $value; return $value;
@@ -184,20 +185,20 @@ class TwoFactorController extends Controller
private function addToMFAHistory(string $mfaCode): void private function addToMFAHistory(string $mfaCode): void
{ {
/** @var array $mfaHistory */ /** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data; $mfaHistory = Preferences::get('mfa_history', [])->data;
$entry = [ $entry = [
'time' => Carbon::now()->getTimestamp(), 'time' => Carbon::now()->getTimestamp(),
'code' => $mfaCode, 'code' => $mfaCode,
]; ];
$mfaHistory[] = $entry; $mfaHistory[] = $entry;
app('preferences')->set('mfa_history', $mfaHistory); Preferences::set('mfa_history', $mfaHistory);
$this->filterMFAHistory(); $this->filterMFAHistory();
} }
private function resetMFAFailureCounter(): void private function resetMFAFailureCounter(): void
{ {
app('preferences')->set('mfa_failure_count', 0); Preferences::set('mfa_failure_count', 0);
Log::channel('audit')->info('MFA failure count is set to zero.'); Log::channel('audit')->info('MFA failure count is set to zero.');
} }
@@ -206,7 +207,7 @@ class TwoFactorController extends Controller
*/ */
private function isBackupCode(string $mfaCode): bool private function isBackupCode(string $mfaCode): bool
{ {
$list = app('preferences')->get('mfa_recovery', [])->data; $list = Preferences::get('mfa_recovery', [])->data;
if (!is_array($list)) { if (!is_array($list)) {
$list = []; $list = [];
} }
@@ -219,7 +220,7 @@ class TwoFactorController extends Controller
*/ */
private function removeFromBackupCodes(string $mfaCode): void private function removeFromBackupCodes(string $mfaCode): void
{ {
$list = app('preferences')->get('mfa_recovery', [])->data; $list = Preferences::get('mfa_recovery', [])->data;
if (!is_array($list)) { if (!is_array($list)) {
$list = []; $list = [];
} }
@@ -238,6 +239,6 @@ class TwoFactorController extends Controller
event(new MFABackupNoLeft($user)); event(new MFABackupNoLeft($user));
} }
app('preferences')->set('mfa_recovery', $newList); Preferences::set('mfa_recovery', $newList);
} }
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Bill; namespace FireflyIII\Http\Controllers\Bill;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
@@ -105,7 +106,7 @@ class CreateController extends Controller
Log::channel('audit')->info('Stored new bill.', $billData); Log::channel('audit')->info('Stored new bill.', $billData);
$request->session()->flash('success', (string) trans('firefly.stored_new_bill', ['name' => $bill->name])); $request->session()->flash('success', (string) trans('firefly.stored_new_bill', ['name' => $bill->name]));
app('preferences')->mark(); Preferences::mark();
/** @var null|array $files */ /** @var null|array $files */
$files = $request->hasFile('attachments') ? $request->file('attachments') : null; $files = $request->hasFile('attachments') ? $request->file('attachments') : null;

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Bill; namespace FireflyIII\Http\Controllers\Bill;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Bill; use FireflyIII\Models\Bill;
use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface;
@@ -83,7 +84,7 @@ class DeleteController extends Controller
$this->repository->destroy($bill); $this->repository->destroy($bill);
$request->session()->flash('success', (string) trans('firefly.deleted_bill', ['name' => $name])); $request->session()->flash('success', (string) trans('firefly.deleted_bill', ['name' => $name]));
app('preferences')->mark(); Preferences::mark();
return redirect($this->getPreviousUrl('bills.delete.url')); return redirect($this->getPreviousUrl('bills.delete.url'));
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Bill; namespace FireflyIII\Http\Controllers\Bill;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\BillUpdateRequest; use FireflyIII\Http\Requests\BillUpdateRequest;
@@ -116,7 +117,7 @@ class EditController extends Controller
Log::channel('audit')->info(sprintf('Updated bill #%d.', $bill->id), $billData); Log::channel('audit')->info(sprintf('Updated bill #%d.', $bill->id), $billData);
$request->session()->flash('success', (string) trans('firefly.updated_bill', ['name' => $bill->name])); $request->session()->flash('success', (string) trans('firefly.updated_bill', ['name' => $bill->name]));
app('preferences')->mark(); Preferences::mark();
/** @var null|array $files */ /** @var null|array $files */
$files = $request->hasFile('attachments') ? $request->file('attachments') : null; $files = $request->hasFile('attachments') ? $request->file('attachments') : null;

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Bill; namespace FireflyIII\Http\Controllers\Bill;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Support\Facades\Navigation; use FireflyIII\Support\Facades\Navigation;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface;
@@ -106,7 +107,7 @@ class ShowController extends Controller
$ruleEngine->fire(); $ruleEngine->fire();
$request->session()->flash('success', trans_choice('firefly.rescanned_bill', $total)); $request->session()->flash('success', trans_choice('firefly.rescanned_bill', $total));
app('preferences')->mark(); Preferences::mark();
return redirect(route('bills.show', [$bill->id])); return redirect(route('bills.show', [$bill->id]));
} }
@@ -132,7 +133,7 @@ class ShowController extends Controller
$end = session('end'); $end = session('end');
$year = $start->year; $year = $start->year;
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$yearAverage = $this->repository->getYearAverage($bill, $start); $yearAverage = $this->repository->getYearAverage($bill, $start);
$overallAverage = $this->repository->getOverallAverage($bill); $overallAverage = $this->repository->getOverallAverage($bill);
$manager = new Manager(); $manager = new Manager();

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget; namespace FireflyIII\Http\Controllers\Budget;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
@@ -255,7 +256,7 @@ class BudgetLimitController extends Controller
$limit = $this->blRepository->update($budgetLimit, ['amount' => $amount, 'notes' => $notes]); $limit = $this->blRepository->update($budgetLimit, ['amount' => $amount, 'notes' => $notes]);
app('preferences')->mark(); Preferences::mark();
$array = $limit->toArray(); $array = $limit->toArray();
$spentArr = $this->opsRepository->sumExpenses( $spentArr = $this->opsRepository->sumExpenses(

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget; namespace FireflyIII\Http\Controllers\Budget;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Enums\AutoBudgetType; use FireflyIII\Enums\AutoBudgetType;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
@@ -116,7 +117,7 @@ class CreateController extends Controller
$budget = $this->repository->store($data); $budget = $this->repository->store($data);
$this->repository->cleanupBudgets(); $this->repository->cleanupBudgets();
$request->session()->flash('success', (string) trans('firefly.stored_new_budget', ['name' => $budget->name])); $request->session()->flash('success', (string) trans('firefly.stored_new_budget', ['name' => $budget->name]));
app('preferences')->mark(); Preferences::mark();
Log::channel('audit')->info('Stored new budget.', $data); Log::channel('audit')->info('Stored new budget.', $data);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget; namespace FireflyIII\Http\Controllers\Budget;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Budget; use FireflyIII\Models\Budget;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
@@ -82,7 +83,7 @@ class DeleteController extends Controller
$name = $budget->name; $name = $budget->name;
$this->repository->destroy($budget); $this->repository->destroy($budget);
$request->session()->flash('success', (string) trans('firefly.deleted_budget', ['name' => $name])); $request->session()->flash('success', (string) trans('firefly.deleted_budget', ['name' => $name]));
app('preferences')->mark(); Preferences::mark();
return redirect($this->getPreviousUrl('budgets.delete.url')); return redirect($this->getPreviousUrl('budgets.delete.url'));
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget; namespace FireflyIII\Http\Controllers\Budget;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Enums\AutoBudgetType; use FireflyIII\Enums\AutoBudgetType;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
@@ -126,7 +127,7 @@ class EditController extends Controller
$request->session()->flash('success', (string) trans('firefly.updated_budget', ['name' => $budget->name])); $request->session()->flash('success', (string) trans('firefly.updated_budget', ['name' => $budget->name]));
$this->repository->cleanupBudgets(); $this->repository->cleanupBudgets();
app('preferences')->mark(); Preferences::mark();
Log::channel('audit')->info(sprintf('Updated budget #%d.', $budget->id), $data); Log::channel('audit')->info(sprintf('Updated budget #%d.', $budget->id), $data);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget; namespace FireflyIII\Http\Controllers\Budget;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Support\Facades\Navigation; use FireflyIII\Support\Facades\Navigation;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
@@ -308,7 +309,7 @@ class IndexController extends Controller
$repository->setBudgetOrder($budget, $index + 1); $repository->setBudgetOrder($budget, $index + 1);
} }
} }
app('preferences')->mark(); Preferences::mark();
return response()->json(['OK']); return response()->json(['OK']);
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget; namespace FireflyIII\Http\Controllers\Budget;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
@@ -98,7 +99,7 @@ class ShowController extends Controller
$firstDate = $first instanceof TransactionJournal ? $first->date : $start; $firstDate = $first instanceof TransactionJournal ? $first->date : $start;
$periods = $this->getNoModelPeriodOverview('budget', $firstDate, $end); $periods = $this->getNoModelPeriodOverview('budget', $firstDate, $end);
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
/** @var GroupCollectorInterface $collector */ /** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class); $collector = app(GroupCollectorInterface::class);
@@ -126,7 +127,7 @@ class ShowController extends Controller
$start = $first instanceof TransactionJournal ? $first->date : new Carbon(); $start = $first instanceof TransactionJournal ? $first->date : new Carbon();
$end = today(config('app.timezone')); $end = today(config('app.timezone'));
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
/** @var GroupCollectorInterface $collector */ /** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class); $collector = app(GroupCollectorInterface::class);
@@ -153,7 +154,7 @@ class ShowController extends Controller
$allStart = session('first', today(config('app.timezone'))->startOfYear()); $allStart = session('first', today(config('app.timezone'))->startOfYear());
$allEnd = today(); $allEnd = today();
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$limits = $this->getLimits($budget, $allStart, $allEnd); $limits = $this->getLimits($budget, $allStart, $allEnd);
$repetition = null; $repetition = null;
$attachments = $this->repository->getAttachments($budget); $attachments = $this->repository->getAttachments($budget);
@@ -190,7 +191,7 @@ class ShowController extends Controller
$currencySymbol = $budgetLimit->transactionCurrency->symbol; $currencySymbol = $budgetLimit->transactionCurrency->symbol;
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$subTitle = trans( $subTitle = trans(
'firefly.budget_in_period', 'firefly.budget_in_period',
[ [

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Category; namespace FireflyIII\Http\Controllers\Category;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
@@ -92,7 +93,7 @@ class CreateController extends Controller
$category = $this->repository->store($data); $category = $this->repository->store($data);
$request->session()->flash('success', (string) trans('firefly.stored_category', ['name' => $category->name])); $request->session()->flash('success', (string) trans('firefly.stored_category', ['name' => $category->name]));
app('preferences')->mark(); Preferences::mark();
// store attachment(s): // store attachment(s):
/** @var null|array $files */ /** @var null|array $files */

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Category; namespace FireflyIII\Http\Controllers\Category;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Category; use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
@@ -83,7 +84,7 @@ class DeleteController extends Controller
$this->repository->destroy($category); $this->repository->destroy($category);
$request->session()->flash('success', (string) trans('firefly.deleted_category', ['name' => $name])); $request->session()->flash('success', (string) trans('firefly.deleted_category', ['name' => $name]));
app('preferences')->mark(); Preferences::mark();
return redirect($this->getPreviousUrl('categories.delete.url')); return redirect($this->getPreviousUrl('categories.delete.url'));
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Category; namespace FireflyIII\Http\Controllers\Category;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\CategoryFormRequest; use FireflyIII\Http\Requests\CategoryFormRequest;
@@ -94,7 +95,7 @@ class EditController extends Controller
$this->repository->update($category, $data); $this->repository->update($category, $data);
$request->session()->flash('success', (string) trans('firefly.updated_category', ['name' => $category->name])); $request->session()->flash('success', (string) trans('firefly.updated_category', ['name' => $category->name]));
app('preferences')->mark(); Preferences::mark();
// store new attachment(s): // store new attachment(s):
/** @var null|array $files */ /** @var null|array $files */

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Category; namespace FireflyIII\Http\Controllers\Category;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Category; use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
@@ -72,7 +73,7 @@ class IndexController extends Controller
public function index(Request $request): Factory|\Illuminate\Contracts\View\View public function index(Request $request): Factory|\Illuminate\Contracts\View\View
{ {
$page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page'); $page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$collection = $this->repository->getCategories(); $collection = $this->repository->getCategories();
$total = $collection->count(); $total = $collection->count();
$collection = $collection->slice(($page - 1) * $pageSize, $pageSize); $collection = $collection->slice(($page - 1) * $pageSize, $pageSize);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Category; namespace FireflyIII\Http\Controllers\Category;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
@@ -86,7 +87,7 @@ class NoCategoryController extends Controller
/** @var Carbon $start */ /** @var Carbon $start */
/** @var Carbon $end */ /** @var Carbon $end */
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$subTitle = trans('firefly.without_category_between', ['start' => $start->isoFormat($this->monthAndDayFormat), 'end' => $end->isoFormat($this->monthAndDayFormat)]); $subTitle = trans('firefly.without_category_between', ['start' => $start->isoFormat($this->monthAndDayFormat), 'end' => $end->isoFormat($this->monthAndDayFormat)]);
$first = $this->journalRepos->firstNull()->date ?? clone $start; $first = $this->journalRepos->firstNull()->date ?? clone $start;
$periods = $this->getNoModelPeriodOverview('category', $first, $end); $periods = $this->getNoModelPeriodOverview('category', $first, $end);
@@ -122,7 +123,7 @@ class NoCategoryController extends Controller
$end = null; $end = null;
$periods = new Collection(); $periods = new Collection();
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
Log::debug('Start of noCategory()'); Log::debug('Start of noCategory()');
$subTitle = (string) trans('firefly.all_journals_without_category'); $subTitle = (string) trans('firefly.all_journals_without_category');
$first = $this->journalRepos->firstNull(); $first = $this->journalRepos->firstNull();

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Category; namespace FireflyIII\Http\Controllers\Category;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface;
@@ -86,7 +87,7 @@ class ShowController extends Controller
$subTitleIcon = 'fa-bookmark'; $subTitleIcon = 'fa-bookmark';
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$attachments = $this->repository->getAttachments($category); $attachments = $this->repository->getAttachments($category);
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$oldest = $this->repository->firstUseDate($category) ?? today(config('app.timezone'))->startOfYear(); $oldest = $this->repository->firstUseDate($category) ?? today(config('app.timezone'))->startOfYear();
$periods = $this->getCategoryPeriodOverview($category, $oldest, $end); $periods = $this->getCategoryPeriodOverview($category, $oldest, $end);
$path = route('categories.show', [$category->id, $start->format('Y-m-d'), $end->format('Y-m-d')]); $path = route('categories.show', [$category->id, $start->format('Y-m-d'), $end->format('Y-m-d')]);
@@ -125,7 +126,7 @@ class ShowController extends Controller
// default values: // default values:
$subTitleIcon = 'fa-bookmark'; $subTitleIcon = 'fa-bookmark';
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$start = null; $start = null;
$end = null; $end = null;
$periods = new Collection(); $periods = new Collection();

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers; namespace FireflyIII\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use Carbon\Exceptions\InvalidFormatException; use Carbon\Exceptions\InvalidFormatException;
use Exception; use Exception;
@@ -146,7 +147,7 @@ class HomeController extends Controller
$count = $repository->count($types); $count = $repository->count($types);
$subTitle = (string) trans('firefly.welcome_back'); $subTitle = (string) trans('firefly.welcome_back');
$transactions = []; $transactions = [];
$frontpage = app('preferences')->getFresh('frontpageAccounts', $repository->getAccountsByType([AccountTypeEnum::ASSET->value])->pluck('id')->toArray()); $frontpage = Preferences::getFresh('frontpageAccounts', $repository->getAccountsByType([AccountTypeEnum::ASSET->value])->pluck('id')->toArray());
$frontpageArray = $frontpage->data; $frontpageArray = $frontpage->data;
if (!is_array($frontpageArray)) { if (!is_array($frontpageArray)) {
$frontpageArray = []; $frontpageArray = [];

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers; namespace FireflyIII\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
@@ -107,7 +108,7 @@ class JavascriptController extends Controller
$locale = app('steam')->getLocale(); $locale = app('steam')->getLocale();
$accounting = app('amount')->getJsConfig(); $accounting = app('amount')->getJsConfig();
$accounting['frac_digits'] = $currency->decimal_places; $accounting['frac_digits'] = $currency->decimal_places;
$pref = app('preferences')->get('language', config('firefly.default_language', 'en_US')); $pref = Preferences::get('language', config('firefly.default_language', 'en_US'));
$lang = $pref->data; $lang = $pref->data;
$dateRange = $this->getDateRangeConfig(); $dateRange = $this->getDateRangeConfig();
$uid = substr(hash('sha256', sprintf('%s-%s-%s', (string) config('app.key'), auth()->user()->id, auth()->user()->email)), 0, 12); $uid = substr(hash('sha256', sprintf('%s-%s-%s', (string) config('app.key'), auth()->user()->id, auth()->user()->email)), 0, 12);

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Json; namespace FireflyIII\Http\Controllers\Json;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Support\Http\Controllers\GetConfigurationData; use FireflyIII\Support\Http\Controllers\GetConfigurationData;
@@ -98,8 +99,8 @@ class IntroController extends Controller
$key = sprintf('%s_%s', $key, $specialPage); $key = sprintf('%s_%s', $key, $specialPage);
} }
Log::debug(sprintf('Going to mark the following route as NOT done: %s with special "%s" (%s)', $route, $specialPage, $key)); Log::debug(sprintf('Going to mark the following route as NOT done: %s with special "%s" (%s)', $route, $specialPage, $key));
app('preferences')->set($key, false); Preferences::set($key, false);
app('preferences')->mark(); Preferences::mark();
return response()->json(['message' => (string) trans('firefly.intro_boxes_after_refresh')]); return response()->json(['message' => (string) trans('firefly.intro_boxes_after_refresh')]);
} }
@@ -115,7 +116,7 @@ class IntroController extends Controller
$key = sprintf('%s_%s', $key, $specialPage); $key = sprintf('%s_%s', $key, $specialPage);
} }
Log::debug(sprintf('Going to mark the following route as done: %s with special "%s" (%s)', $route, $specialPage, $key)); Log::debug(sprintf('Going to mark the following route as done: %s with special "%s" (%s)', $route, $specialPage, $key));
app('preferences')->set($key, true); Preferences::set($key, true);
return response()->json(['result' => sprintf('Reported demo watched for route "%s" (%s): %s.', $route, $specialPage, $key)]); return response()->json(['result' => sprintf('Reported demo watched for route "%s" (%s): %s.', $route, $specialPage, $key)]);
} }

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers; namespace FireflyIII\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Http\Requests\NewUserFormRequest; use FireflyIII\Http\Requests\NewUserFormRequest;
use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\TransactionCurrency;
@@ -92,7 +93,7 @@ class NewUserController extends Controller
} }
// set language preference: // set language preference:
app('preferences')->set('language', $language); Preferences::set('language', $language);
// Store currency preference from input: // Store currency preference from input:
$currency = $currencyRepository->find((int) $request->input('amount_currency_id_bank_balance')); $currency = $currencyRepository->find((int) $request->input('amount_currency_id_bank_balance'));
@@ -111,10 +112,10 @@ class NewUserController extends Controller
// store frontpage preferences: // store frontpage preferences:
$accounts = $this->repository->getAccountsByType([AccountTypeEnum::ASSET->value])->pluck('id')->toArray(); $accounts = $this->repository->getAccountsByType([AccountTypeEnum::ASSET->value])->pluck('id')->toArray();
app('preferences')->set('frontpageAccounts', $accounts); Preferences::set('frontpageAccounts', $accounts);
// mark. // mark.
app('preferences')->mark(); Preferences::mark();
// set default optional fields: // set default optional fields:
$visibleFields = [ $visibleFields = [
@@ -128,10 +129,10 @@ class NewUserController extends Controller
'notes' => true, 'notes' => true,
'attachments' => true, 'attachments' => true,
]; ];
app('preferences')->set('transaction_journal_optional_fields', $visibleFields); Preferences::set('transaction_journal_optional_fields', $visibleFields);
session()->flash('success', (string) trans('firefly.stored_new_accounts_new_user')); session()->flash('success', (string) trans('firefly.stored_new_accounts_new_user'));
app('preferences')->mark(); Preferences::mark();
return redirect(route('index')); return redirect(route('index'));
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\ObjectGroup; namespace FireflyIII\Http\Controllers\ObjectGroup;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\ObjectGroup; use FireflyIII\Models\ObjectGroup;
use FireflyIII\Repositories\ObjectGroup\ObjectGroupRepositoryInterface; use FireflyIII\Repositories\ObjectGroup\ObjectGroupRepositoryInterface;
@@ -77,7 +78,7 @@ class DeleteController extends Controller
public function destroy(ObjectGroup $objectGroup): RedirectResponse public function destroy(ObjectGroup $objectGroup): RedirectResponse
{ {
session()->flash('success', (string) trans('firefly.deleted_object_group', ['title' => $objectGroup->title])); session()->flash('success', (string) trans('firefly.deleted_object_group', ['title' => $objectGroup->title]));
app('preferences')->mark(); Preferences::mark();
$this->repository->destroy($objectGroup); $this->repository->destroy($objectGroup);
return redirect($this->getPreviousUrl('object-groups.delete.url')); return redirect($this->getPreviousUrl('object-groups.delete.url'));

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\ObjectGroup; namespace FireflyIII\Http\Controllers\ObjectGroup;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\ObjectGroupFormRequest; use FireflyIII\Http\Requests\ObjectGroupFormRequest;
use FireflyIII\Models\ObjectGroup; use FireflyIII\Models\ObjectGroup;
@@ -87,7 +88,7 @@ class EditController extends Controller
$piggyBank = $this->repository->update($objectGroup, $data); $piggyBank = $this->repository->update($objectGroup, $data);
session()->flash('success', (string) trans('firefly.updated_object_group', ['title' => $objectGroup->title])); session()->flash('success', (string) trans('firefly.updated_object_group', ['title' => $objectGroup->title]));
app('preferences')->mark(); Preferences::mark();
$redirect = redirect($this->getPreviousUrl('object-groups.edit.url')); $redirect = redirect($this->getPreviousUrl('object-groups.edit.url'));

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\PiggyBank; namespace FireflyIII\Http\Controllers\PiggyBank;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
@@ -167,7 +168,7 @@ class AmountController extends Controller
} }
if (0 !== bccomp($total, '0')) { if (0 !== bccomp($total, '0')) {
session()->flash('success', (string) trans('firefly.added_amount_to_piggy', ['amount' => app('amount')->formatAnything($piggyBank->transactionCurrency, $total, false), 'name' => $piggyBank->name])); session()->flash('success', (string) trans('firefly.added_amount_to_piggy', ['amount' => app('amount')->formatAnything($piggyBank->transactionCurrency, $total, false), 'name' => $piggyBank->name]));
app('preferences')->mark(); Preferences::mark();
return redirect(route('piggy-banks.index')); return redirect(route('piggy-banks.index'));
} }
@@ -216,7 +217,7 @@ class AmountController extends Controller
['amount' => app('amount')->formatAnything($piggyBank->transactionCurrency, $total, false), 'name' => $piggyBank->name] ['amount' => app('amount')->formatAnything($piggyBank->transactionCurrency, $total, false), 'name' => $piggyBank->name]
) )
); );
app('preferences')->mark(); Preferences::mark();
return redirect(route('piggy-banks.index')); return redirect(route('piggy-banks.index'));
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\PiggyBank; namespace FireflyIII\Http\Controllers\PiggyBank;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
@@ -106,7 +107,7 @@ class CreateController extends Controller
session()->flash('success', (string) trans('firefly.stored_piggy_bank', ['name' => $piggyBank->name])); session()->flash('success', (string) trans('firefly.stored_piggy_bank', ['name' => $piggyBank->name]));
session()->flash('success_url', route('piggy-banks.show', [$piggyBank->id])); session()->flash('success_url', route('piggy-banks.show', [$piggyBank->id]));
app('preferences')->mark(); Preferences::mark();
// store attachment(s): // store attachment(s):
/** @var null|array $files */ /** @var null|array $files */

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\PiggyBank; namespace FireflyIII\Http\Controllers\PiggyBank;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBank;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
@@ -78,7 +79,7 @@ class DeleteController extends Controller
public function destroy(PiggyBank $piggyBank): RedirectResponse public function destroy(PiggyBank $piggyBank): RedirectResponse
{ {
session()->flash('success', (string) trans('firefly.deleted_piggy_bank', ['name' => $piggyBank->name])); session()->flash('success', (string) trans('firefly.deleted_piggy_bank', ['name' => $piggyBank->name]));
app('preferences')->mark(); Preferences::mark();
$this->piggyRepos->destroy($piggyBank); $this->piggyRepos->destroy($piggyBank);
return redirect($this->getPreviousUrl('piggy-banks.delete.url')); return redirect($this->getPreviousUrl('piggy-banks.delete.url'));

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\PiggyBank; namespace FireflyIII\Http\Controllers\PiggyBank;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\PiggyBankUpdateRequest; use FireflyIII\Http\Requests\PiggyBankUpdateRequest;
@@ -121,7 +122,7 @@ class EditController extends Controller
$piggyBank = $this->piggyRepos->update($piggyBank, $data); $piggyBank = $this->piggyRepos->update($piggyBank, $data);
session()->flash('success', (string) trans('firefly.updated_piggy_bank', ['name' => $piggyBank->name])); session()->flash('success', (string) trans('firefly.updated_piggy_bank', ['name' => $piggyBank->name]));
app('preferences')->mark(); Preferences::mark();
// store new attachment(s): // store new attachment(s):
/** @var null|array $files */ /** @var null|array $files */

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Profile; namespace FireflyIII\Http\Controllers\Profile;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Events\Security\DisabledMFA; use FireflyIII\Events\Security\DisabledMFA;
use FireflyIII\Events\Security\EnabledMFA; use FireflyIII\Events\Security\EnabledMFA;
@@ -124,8 +125,8 @@ class MfaController extends Controller
; ;
$codes = implode("\r\n", $recoveryCodes); $codes = implode("\r\n", $recoveryCodes);
app('preferences')->set('mfa_recovery', $recoveryCodes); Preferences::set('mfa_recovery', $recoveryCodes);
app('preferences')->mark(); Preferences::mark();
// send user notification. // send user notification.
$user = auth()->user(); $user = auth()->user();
@@ -172,10 +173,10 @@ class MfaController extends Controller
/** @var User $user */ /** @var User $user */
$user = auth()->user(); $user = auth()->user();
app('preferences')->delete('temp-mfa-secret'); Preferences::delete('temp-mfa-secret');
app('preferences')->delete('temp-mfa-codes'); Preferences::delete('temp-mfa-codes');
$repository->setMFACode($user, null); $repository->setMFACode($user, null);
app('preferences')->mark(); Preferences::mark();
session()->flash('success', (string) trans('firefly.pref_two_factor_auth_disabled')); session()->flash('success', (string) trans('firefly.pref_two_factor_auth_disabled'));
session()->flash('info', (string) trans('firefly.pref_two_factor_auth_remove_it')); session()->flash('info', (string) trans('firefly.pref_two_factor_auth_remove_it'));
@@ -218,7 +219,7 @@ class MfaController extends Controller
$secret = Google2FA::generateSecretKey(); $secret = Google2FA::generateSecretKey();
$image = Google2FA::getQRCodeInline($domain, auth()->user()->email, $secret); $image = Google2FA::getQRCodeInline($domain, auth()->user()->email, $secret);
app('preferences')->set('temp-mfa-secret', $secret); Preferences::set('temp-mfa-secret', $secret);
return view('profile.mfa.enable-mfa', ['image' => $image, 'secret' => $secret]); return view('profile.mfa.enable-mfa', ['image' => $image, 'secret' => $secret]);
@@ -252,7 +253,7 @@ class MfaController extends Controller
/** @var UserRepositoryInterface $repository */ /** @var UserRepositoryInterface $repository */
$repository = app(UserRepositoryInterface::class); $repository = app(UserRepositoryInterface::class);
$secret = app('preferences')->get('temp-mfa-secret')?->data; $secret = Preferences::get('temp-mfa-secret')?->data;
if (is_array($secret)) { if (is_array($secret)) {
$secret = null; $secret = null;
} }
@@ -260,10 +261,10 @@ class MfaController extends Controller
$repository->setMFACode($user, $secret); $repository->setMFACode($user, $secret);
app('preferences')->delete('temp-mfa-secret'); Preferences::delete('temp-mfa-secret');
session()->flash('success', (string) trans('firefly.saved_preferences')); session()->flash('success', (string) trans('firefly.saved_preferences'));
app('preferences')->mark(); Preferences::mark();
// also save the code so replay attack is prevented. // also save the code so replay attack is prevented.
$mfaCode = $request->get('code'); $mfaCode = $request->get('code');
@@ -293,14 +294,14 @@ class MfaController extends Controller
private function addToMFAHistory(string $mfaCode): void private function addToMFAHistory(string $mfaCode): void
{ {
/** @var array $mfaHistory */ /** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data; $mfaHistory = Preferences::get('mfa_history', [])->data;
$entry = [ $entry = [
'time' => Carbon::now()->getTimestamp(), 'time' => Carbon::now()->getTimestamp(),
'code' => $mfaCode, 'code' => $mfaCode,
]; ];
$mfaHistory[] = $entry; $mfaHistory[] = $entry;
app('preferences')->set('mfa_history', $mfaHistory); Preferences::set('mfa_history', $mfaHistory);
$this->filterMFAHistory(); $this->filterMFAHistory();
} }
@@ -310,7 +311,7 @@ class MfaController extends Controller
private function filterMFAHistory(): void private function filterMFAHistory(): void
{ {
/** @var array $mfaHistory */ /** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data; $mfaHistory = Preferences::get('mfa_history', [])->data;
$newHistory = []; $newHistory = [];
$now = Carbon::now()->getTimestamp(); $now = Carbon::now()->getTimestamp();
foreach ($mfaHistory as $entry) { foreach ($mfaHistory as $entry) {
@@ -323,7 +324,7 @@ class MfaController extends Controller
]; ];
} }
} }
app('preferences')->set('mfa_history', $newHistory); Preferences::set('mfa_history', $newHistory);
} }
public function index(): Factory|RedirectResponse|View public function index(): Factory|RedirectResponse|View

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers; namespace FireflyIII\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Exception; use Exception;
use FireflyIII\Events\UserChangedEmail; use FireflyIII\Events\UserChangedEmail;
@@ -98,7 +99,7 @@ class ProfileController extends Controller
// find preference with this token value. // find preference with this token value.
/** @var Collection $set */ /** @var Collection $set */
$set = app('preferences')->findByName('email_change_confirm_token'); $set = Preferences::findByName('email_change_confirm_token');
$user = null; $user = null;
/** @var Preference $preference */ /** @var Preference $preference */
@@ -151,7 +152,7 @@ class ProfileController extends Controller
$subTitle = $user->email; $subTitle = $user->email;
$userId = $user->id; $userId = $user->id;
$enabled2FA = null !== $user->mfa_secret; $enabled2FA = null !== $user->mfa_secret;
$recoveryData = app('preferences')->get('mfa_recovery', [])->data; $recoveryData = Preferences::get('mfa_recovery', [])->data;
if (!is_array($recoveryData)) { if (!is_array($recoveryData)) {
$recoveryData = []; $recoveryData = [];
} }
@@ -165,10 +166,10 @@ class ProfileController extends Controller
$repository->createPersonalAccessClient(null, $name, 'http://localhost'); $repository->createPersonalAccessClient(null, $name, 'http://localhost');
} }
$accessToken = app('preferences')->get('access_token'); $accessToken = Preferences::get('access_token');
if (null === $accessToken) { if (null === $accessToken) {
$token = $user->generateAccessToken(); $token = $user->generateAccessToken();
$accessToken = app('preferences')->set('access_token', $token); $accessToken = Preferences::set('access_token', $token);
} }
return view( return view(
@@ -374,7 +375,7 @@ class ProfileController extends Controller
/** @var User $user */ /** @var User $user */
$user = auth()->user(); $user = auth()->user();
$token = $user->generateAccessToken(); $token = $user->generateAccessToken();
app('preferences')->set('access_token', $token); Preferences::set('access_token', $token);
session()->flash('success', (string) trans('firefly.token_regenerated')); session()->flash('success', (string) trans('firefly.token_regenerated'));
return redirect(route('profile.index')); return redirect(route('profile.index'));
@@ -392,7 +393,7 @@ class ProfileController extends Controller
} }
// find preference with this token value. // find preference with this token value.
$set = app('preferences')->findByName('email_change_undo_token'); $set = Preferences::findByName('email_change_undo_token');
$user = null; $user = null;
/** @var Preference $preference */ /** @var Preference $preference */
@@ -406,7 +407,7 @@ class ProfileController extends Controller
} }
// found user.which email address to return to? // found user.which email address to return to?
$set = app('preferences')->beginsWith($user, 'previous_email_'); $set = Preferences::beginsWith($user, 'previous_email_');
/** @var null|string $match */ /** @var null|string $match */
$match = null; $match = null;

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Recurring; namespace FireflyIII\Http\Controllers\Recurring;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Enums\RecurrenceRepetitionWeekend; use FireflyIII\Enums\RecurrenceRepetitionWeekend;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
@@ -228,7 +229,7 @@ class CreateController extends Controller
Log::channel('audit')->info('Stored new recurrence.', $data); Log::channel('audit')->info('Stored new recurrence.', $data);
$request->session()->flash('success', (string) trans('firefly.stored_new_recurrence', ['title' => $recurrence->title])); $request->session()->flash('success', (string) trans('firefly.stored_new_recurrence', ['title' => $recurrence->title]));
app('preferences')->mark(); Preferences::mark();
// store attachment(s): // store attachment(s):
/** @var null|array $files */ /** @var null|array $files */

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Recurring; namespace FireflyIII\Http\Controllers\Recurring;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Recurrence; use FireflyIII\Models\Recurrence;
use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface; use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;
@@ -83,7 +84,7 @@ class DeleteController extends Controller
{ {
$repository->destroy($recurrence); $repository->destroy($recurrence);
$request->session()->flash('success', (string) trans('firefly.recurrence_deleted', ['title' => $recurrence->title])); $request->session()->flash('success', (string) trans('firefly.recurrence_deleted', ['title' => $recurrence->title]));
app('preferences')->mark(); Preferences::mark();
return redirect($this->getPreviousUrl('recurrences.delete.url')); return redirect($this->getPreviousUrl('recurrences.delete.url'));
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Recurring; namespace FireflyIII\Http\Controllers\Recurring;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Enums\RecurrenceRepetitionWeekend; use FireflyIII\Enums\RecurrenceRepetitionWeekend;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
@@ -193,7 +194,7 @@ class EditController extends Controller
if (count($this->attachments->getMessages()->get('attachments')) > 0) { if (count($this->attachments->getMessages()->get('attachments')) > 0) {
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments')); $request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
} }
app('preferences')->mark(); Preferences::mark();
$redirect = redirect($this->getPreviousUrl('recurrences.edit.url')); $redirect = redirect($this->getPreviousUrl('recurrences.edit.url'));
if (1 === (int) $request->get('return_to_edit')) { if (1 === (int) $request->get('return_to_edit')) {
// set value so edit routine will not overwrite URL: // set value so edit routine will not overwrite URL:

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Recurring; namespace FireflyIII\Http\Controllers\Recurring;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
@@ -82,7 +83,7 @@ class IndexController extends Controller
public function index(Request $request): Factory|\Illuminate\Contracts\View\View public function index(Request $request): Factory|\Illuminate\Contracts\View\View
{ {
$page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page'); $page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$collection = $this->repository->get(); $collection = $this->repository->get();
$today = today(config('app.timezone')); $today = today(config('app.timezone'));
$year = today(config('app.timezone')); $year = today(config('app.timezone'));

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers; namespace FireflyIII\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\AccountTypeEnum;
@@ -227,7 +228,7 @@ class ReportController extends Controller
/** @var Carbon $start */ /** @var Carbon $start */
$start = clone session('first', today(config('app.timezone'))); $start = clone session('first', today(config('app.timezone')));
$months = $this->helper->listOfMonths($start); $months = $this->helper->listOfMonths($start);
$customFiscalYear = app('preferences')->get('customFiscalYear', 0)->data; $customFiscalYear = Preferences::get('customFiscalYear', 0)->data;
$accounts = $repository->getAccountsByType( $accounts = $repository->getAccountsByType(
[AccountTypeEnum::DEFAULT->value, AccountTypeEnum::ASSET->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::MORTGAGE->value] [AccountTypeEnum::DEFAULT->value, AccountTypeEnum::ASSET->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::MORTGAGE->value]
); );

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Rule; namespace FireflyIII\Http\Controllers\Rule;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\RuleFormRequest; use FireflyIII\Http\Requests\RuleFormRequest;
@@ -269,7 +270,7 @@ class CreateController extends Controller
$rule = $this->ruleRepos->store($data); $rule = $this->ruleRepos->store($data);
session()->flash('success_url', route('rules.select-transactions', [$rule->id])); session()->flash('success_url', route('rules.select-transactions', [$rule->id]));
session()->flash('success', (string) trans('firefly.stored_new_rule', ['title' => $rule->title])); session()->flash('success', (string) trans('firefly.stored_new_rule', ['title' => $rule->title]));
app('preferences')->mark(); Preferences::mark();
// redirect to show bill. // redirect to show bill.
if ('true' === $request->get('return_to_bill') && (int) $request->get('bill_id') > 0) { if ('true' === $request->get('return_to_bill') && (int) $request->get('bill_id') > 0) {

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Rule; namespace FireflyIII\Http\Controllers\Rule;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Rule; use FireflyIII\Models\Rule;
use FireflyIII\Repositories\Rule\RuleRepositoryInterface; use FireflyIII\Repositories\Rule\RuleRepositoryInterface;
@@ -82,7 +83,7 @@ class DeleteController extends Controller
$this->ruleRepos->destroy($rule); $this->ruleRepos->destroy($rule);
session()->flash('success', (string) trans('firefly.deleted_rule', ['title' => $title])); session()->flash('success', (string) trans('firefly.deleted_rule', ['title' => $title]));
app('preferences')->mark(); Preferences::mark();
return redirect($this->getPreviousUrl('rules.delete.url')); return redirect($this->getPreviousUrl('rules.delete.url'));
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Rule; namespace FireflyIII\Http\Controllers\Rule;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
@@ -204,7 +205,7 @@ class EditController extends Controller
$this->ruleRepos->update($rule, $data); $this->ruleRepos->update($rule, $data);
session()->flash('success', (string) trans('firefly.updated_rule', ['title' => $rule->title])); session()->flash('success', (string) trans('firefly.updated_rule', ['title' => $rule->title]));
app('preferences')->mark(); Preferences::mark();
$redirect = redirect($this->getPreviousUrl('rules.edit.url')); $redirect = redirect($this->getPreviousUrl('rules.edit.url'));
if (true === $data['run_after_form']) { if (true === $data['run_after_form']) {

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\RuleGroup; namespace FireflyIII\Http\Controllers\RuleGroup;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\RuleGroupFormRequest; use FireflyIII\Http\Requests\RuleGroupFormRequest;
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface; use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
@@ -89,7 +90,7 @@ class CreateController extends Controller
$ruleGroup = $this->repository->store($data); $ruleGroup = $this->repository->store($data);
session()->flash('success', (string) trans('firefly.created_new_rule_group', ['title' => $ruleGroup->title])); session()->flash('success', (string) trans('firefly.created_new_rule_group', ['title' => $ruleGroup->title]));
app('preferences')->mark(); Preferences::mark();
$redirect = redirect($this->getPreviousUrl('rule-groups.create.url')); $redirect = redirect($this->getPreviousUrl('rule-groups.create.url'));
if (1 === (int) $request->get('create_another')) { if (1 === (int) $request->get('create_another')) {

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\RuleGroup; namespace FireflyIII\Http\Controllers\RuleGroup;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\RuleGroup; use FireflyIII\Models\RuleGroup;
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface; use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
@@ -87,7 +88,7 @@ class DeleteController extends Controller
$this->repository->destroy($ruleGroup, $moveTo); $this->repository->destroy($ruleGroup, $moveTo);
session()->flash('success', (string) trans('firefly.deleted_rule_group', ['title' => $title])); session()->flash('success', (string) trans('firefly.deleted_rule_group', ['title' => $title]));
app('preferences')->mark(); Preferences::mark();
return redirect($this->getPreviousUrl('rule-groups.delete.url')); return redirect($this->getPreviousUrl('rule-groups.delete.url'));
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\RuleGroup; namespace FireflyIII\Http\Controllers\RuleGroup;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\RuleGroupFormRequest; use FireflyIII\Http\Requests\RuleGroupFormRequest;
use FireflyIII\Models\RuleGroup; use FireflyIII\Models\RuleGroup;
@@ -129,7 +130,7 @@ class EditController extends Controller
$this->repository->update($ruleGroup, $data); $this->repository->update($ruleGroup, $data);
session()->flash('success', (string) trans('firefly.updated_rule_group', ['title' => $ruleGroup->title])); session()->flash('success', (string) trans('firefly.updated_rule_group', ['title' => $ruleGroup->title]));
app('preferences')->mark(); Preferences::mark();
$redirect = redirect($this->getPreviousUrl('rule-groups.edit.url')); $redirect = redirect($this->getPreviousUrl('rule-groups.edit.url'));
if (1 === (int) $request->get('return_to_edit')) { if (1 === (int) $request->get('return_to_edit')) {
session()->put('rule-groups.edit.fromUpdate', true); session()->put('rule-groups.edit.fromUpdate', true);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\System; namespace FireflyIII\Http\Controllers\System;
use FireflyIII\Support\Facades\Preferences;
use Exception; use Exception;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
@@ -149,7 +150,7 @@ class InstallController extends Controller
} }
// clear cache as well. // clear cache as well.
Cache::clear(); Cache::clear();
app('preferences')->mark(); Preferences::mark();
return true; return true;
} }

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers; namespace FireflyIII\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
@@ -212,7 +213,7 @@ class TagController extends Controller
$this->repository->destroy($tag); $this->repository->destroy($tag);
session()->flash('success', (string) trans('firefly.deleted_tag', ['tag' => $tagName])); session()->flash('success', (string) trans('firefly.deleted_tag', ['tag' => $tagName]));
app('preferences')->mark(); Preferences::mark();
return redirect($this->getPreviousUrl('tags.delete.url')); return redirect($this->getPreviousUrl('tags.delete.url'));
} }
@@ -231,7 +232,7 @@ class TagController extends Controller
// default values: // default values:
$subTitleIcon = 'fa-tag'; $subTitleIcon = 'fa-tag';
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$start ??= session('start'); $start ??= session('start');
$end ??= session('end'); $end ??= session('end');
$location = $this->repository->getLocation($tag); $location = $this->repository->getLocation($tag);
@@ -275,7 +276,7 @@ class TagController extends Controller
// default values: // default values:
$subTitleIcon = 'fa-tag'; $subTitleIcon = 'fa-tag';
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$periods = []; $periods = [];
$subTitle = (string) trans('firefly.all_journals_for_tag', ['tag' => $tag->tag]); $subTitle = (string) trans('firefly.all_journals_for_tag', ['tag' => $tag->tag]);
$start = $this->repository->firstUseDate($tag) ?? today(config('app.timezone')); $start = $this->repository->firstUseDate($tag) ?? today(config('app.timezone'));
@@ -309,7 +310,7 @@ class TagController extends Controller
Log::debug('Data after storage', $result->toArray()); Log::debug('Data after storage', $result->toArray());
session()->flash('success', (string) trans('firefly.created_tag', ['tag' => $data['tag']])); session()->flash('success', (string) trans('firefly.created_tag', ['tag' => $data['tag']]));
app('preferences')->mark(); Preferences::mark();
// store attachment(s): // store attachment(s):
/** @var null|array $files */ /** @var null|array $files */
@@ -347,7 +348,7 @@ class TagController extends Controller
$tag = $this->repository->update($tag, $data); $tag = $this->repository->update($tag, $data);
session()->flash('success', (string) trans('firefly.updated_tag', ['tag' => $data['tag']])); session()->flash('success', (string) trans('firefly.updated_tag', ['tag' => $data['tag']]));
app('preferences')->mark(); Preferences::mark();
// store new attachment(s): // store new attachment(s):
/** @var null|array $files */ /** @var null|array $files */

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction; namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use FireflyIII\Events\UpdatedTransactionGroup; use FireflyIII\Events\UpdatedTransactionGroup;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
@@ -122,7 +123,7 @@ class BulkController extends Controller
event(new UpdatedTransactionGroup($journal->transactionGroup, true, true, false)); event(new UpdatedTransactionGroup($journal->transactionGroup, true, true, false));
} }
app('preferences')->mark(); Preferences::mark();
$request->session()->flash('success', trans_choice('firefly.mass_edited_transactions_success', $count)); $request->session()->flash('success', trans_choice('firefly.mass_edited_transactions_success', $count));
// redirect to previous URL: // redirect to previous URL:

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction; namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use FireflyIII\Events\UpdatedAccount; use FireflyIII\Events\UpdatedAccount;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
@@ -129,7 +130,7 @@ class DeleteController extends Controller
Log::debug(sprintf('Now going to trigger updated account event for account #%d', $account->id)); Log::debug(sprintf('Now going to trigger updated account event for account #%d', $account->id));
event(new UpdatedAccount($account)); event(new UpdatedAccount($account));
} }
app('preferences')->mark(); Preferences::mark();
return redirect($this->getPreviousUrl('transactions.delete.url')); return redirect($this->getPreviousUrl('transactions.delete.url'));
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction; namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionGroup;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
@@ -76,7 +77,7 @@ class EditController extends Controller
*/ */
public function edit(TransactionGroup $transactionGroup): Factory|\Illuminate\Contracts\View\View|Redirector|RedirectResponse public function edit(TransactionGroup $transactionGroup): Factory|\Illuminate\Contracts\View\View|Redirector|RedirectResponse
{ {
app('preferences')->mark(); Preferences::mark();
if (!$this->isEditableGroup($transactionGroup)) { if (!$this->isEditableGroup($transactionGroup)) {
return $this->redirectGroupToAccount($transactionGroup); return $this->redirectGroupToAccount($transactionGroup);
@@ -98,7 +99,7 @@ class EditController extends Controller
$previousUrl = str_replace($search, '', $previousUrl); $previousUrl = str_replace($search, '', $previousUrl);
// settings necessary for v2 // settings necessary for v2
$optionalFields = app('preferences')->get('transaction_journal_optional_fields', [])->data; $optionalFields = Preferences::get('transaction_journal_optional_fields', [])->data;
if (!is_array($optionalFields)) { if (!is_array($optionalFields)) {
$optionalFields = []; $optionalFields = [];
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction; namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface;
@@ -84,7 +85,7 @@ class IndexController extends Controller
$subTitleIcon = config('firefly.transactionIconsByType.'.$objectType); $subTitleIcon = config('firefly.transactionIconsByType.'.$objectType);
$types = config('firefly.transactionTypesByType.'.$objectType); $types = config('firefly.transactionTypesByType.'.$objectType);
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
if (!$start instanceof Carbon) { if (!$start instanceof Carbon) {
$start = session('start'); $start = session('start');
@@ -137,7 +138,7 @@ class IndexController extends Controller
$subTitleIcon = config('firefly.transactionIconsByType.'.$objectType); $subTitleIcon = config('firefly.transactionIconsByType.'.$objectType);
$types = config('firefly.transactionTypesByType.'.$objectType); $types = config('firefly.transactionTypesByType.'.$objectType);
$page = (int) $request->get('page'); $page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$path = route('transactions.index.all', [$objectType]); $path = route('transactions.index.all', [$objectType]);
$first = $this->repository->firstNull(); $first = $this->repository->firstNull();
$start = $first instanceof TransactionJournal ? $first->date : new Carbon(); $start = $first instanceof TransactionJournal ? $first->date : new Carbon();

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction; namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\JournalLinkRequest; use FireflyIII\Http\Requests\JournalLinkRequest;
@@ -86,7 +87,7 @@ class LinkController extends Controller
$this->repository->destroyLink($link); $this->repository->destroyLink($link);
session()->flash('success', (string) trans('firefly.deleted_link')); session()->flash('success', (string) trans('firefly.deleted_link'));
app('preferences')->mark(); Preferences::mark();
return redirect((string) session('journal_links.delete.url')); return redirect((string) session('journal_links.delete.url'));
} }

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction; namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Enums\TransactionTypeEnum; use FireflyIII\Enums\TransactionTypeEnum;
@@ -110,7 +111,7 @@ class MassController extends Controller
Log::debug(sprintf('Could not find transaction journal #%d', $journalId)); Log::debug(sprintf('Could not find transaction journal #%d', $journalId));
} }
} }
app('preferences')->mark(); Preferences::mark();
session()->flash('success', trans_choice('firefly.mass_deleted_transactions_success', $count)); session()->flash('success', trans_choice('firefly.mass_deleted_transactions_success', $count));
// redirect to previous URL: // redirect to previous URL:
@@ -177,7 +178,7 @@ class MassController extends Controller
} }
} }
app('preferences')->mark(); Preferences::mark();
session()->flash('success', trans_choice('firefly.mass_edited_transactions_success', $count)); session()->flash('success', trans_choice('firefly.mass_edited_transactions_success', $count));
// redirect to previous URL: // redirect to previous URL:

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\TransactionCurrency; namespace FireflyIII\Http\Controllers\TransactionCurrency;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\CurrencyFormRequest; use FireflyIII\Http\Requests\CurrencyFormRequest;
@@ -128,7 +129,7 @@ class EditController extends Controller
$currency = $this->repository->update($currency, $data); $currency = $this->repository->update($currency, $data);
Log::channel('audit')->info('Updated (POST) currency.', $data); Log::channel('audit')->info('Updated (POST) currency.', $data);
$request->session()->flash('success', (string) trans('firefly.updated_currency', ['name' => $currency->name])); $request->session()->flash('success', (string) trans('firefly.updated_currency', ['name' => $currency->name]));
app('preferences')->mark(); Preferences::mark();
if (1 === (int) $request->get('return_to_edit')) { if (1 === (int) $request->get('return_to_edit')) {
$request->session()->put('currencies.edit.fromUpdate', true); $request->session()->put('currencies.edit.fromUpdate', true);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\TransactionCurrency; namespace FireflyIII\Http\Controllers\TransactionCurrency;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
@@ -73,7 +74,7 @@ class IndexController extends Controller
/** @var User $user */ /** @var User $user */
$user = auth()->user(); $user = auth()->user();
$page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page'); $page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data; $pageSize = (int) Preferences::get('listPageSize', 50)->data;
$collection = $this->repository->getAll(); $collection = $this->repository->getAll();
// order so default and enabled are on top: // order so default and enabled are on top:

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Middleware; namespace FireflyIII\Http\Middleware;
use FireflyIII\Support\Facades\Preferences;
use Closure; use Closure;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
@@ -54,27 +55,27 @@ class InterestingMessage
} }
if ($this->groupMessage($request)) { if ($this->groupMessage($request)) {
app('preferences')->mark(); Preferences::mark();
$this->handleGroupMessage($request); $this->handleGroupMessage($request);
} }
if ($this->userGroupMessage($request)) { if ($this->userGroupMessage($request)) {
app('preferences')->mark(); Preferences::mark();
$this->handleUserGroupMessage($request); $this->handleUserGroupMessage($request);
} }
if ($this->accountMessage($request)) { if ($this->accountMessage($request)) {
app('preferences')->mark(); Preferences::mark();
$this->handleAccountMessage($request); $this->handleAccountMessage($request);
} }
if ($this->billMessage($request)) { if ($this->billMessage($request)) {
app('preferences')->mark(); Preferences::mark();
$this->handleBillMessage($request); $this->handleBillMessage($request);
} }
if ($this->webhookMessage($request)) { if ($this->webhookMessage($request)) {
app('preferences')->mark(); Preferences::mark();
$this->handleWebhookMessage($request); $this->handleWebhookMessage($request);
} }
if ($this->currencyMessage($request)) { if ($this->currencyMessage($request)) {
app('preferences')->mark(); Preferences::mark();
$this->handleCurrencyMessage($request); $this->handleCurrencyMessage($request);
} }

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Middleware; namespace FireflyIII\Http\Middleware;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Support\Facades\Navigation; use FireflyIII\Support\Facades\Navigation;
use Carbon\Carbon; use Carbon\Carbon;
use Closure; use Closure;
@@ -70,7 +71,7 @@ class Range
// ignore preference. set the range to be the current month: // ignore preference. set the range to be the current month:
if (!app('session')->has('start') && !app('session')->has('end')) { if (!app('session')->has('start') && !app('session')->has('end')) {
Log::debug('setRange: Session has no start or end.'); Log::debug('setRange: Session has no start or end.');
$viewRange = app('preferences')->get('viewRange', '1M')->data; $viewRange = Preferences::get('viewRange', '1M')->data;
if (is_array($viewRange)) { if (is_array($viewRange)) {
$viewRange = '1M'; $viewRange = '1M';
} }
@@ -138,7 +139,7 @@ class Range
*/ */
private function configureList(): void private function configureList(): void
{ {
$pref = app('preferences')->get('list-length', config('firefly.list_length', 10))->data; $pref = Preferences::get('list-length', config('firefly.list_length', 10))->data;
app('view')->share('listLength', $pref); app('view')->share('listLength', $pref);
// share security message: // share security message:

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Jobs; namespace FireflyIII\Jobs;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Events\RequestedReportOnJournals; use FireflyIII\Events\RequestedReportOnJournals;
use FireflyIII\Events\StoredTransactionGroup; use FireflyIII\Events\StoredTransactionGroup;
@@ -132,7 +133,7 @@ class CreateRecurringTransactions implements ShouldQueue
$this->groupRepository->setUser($recurrence->user); $this->groupRepository->setUser($recurrence->user);
// clear cache for user // clear cache for user
app('preferences')->setForUser($recurrence->user, 'lastActivity', microtime()); Preferences::setForUser($recurrence->user, 'lastActivity', microtime());
Log::debug(sprintf('Now at recurrence #%d of user #%d', $recurrence->id, $recurrence->user_id)); Log::debug(sprintf('Now at recurrence #%d of user #%d', $recurrence->id, $recurrence->user_id));
$createdReps = $this->handleRepetitions($recurrence); $createdReps = $this->handleRepetitions($recurrence);
@@ -150,7 +151,7 @@ class CreateRecurringTransactions implements ShouldQueue
Log::debug('Done with handle()'); Log::debug('Done with handle()');
// clear cache: // clear cache:
app('preferences')->mark(); Preferences::mark();
} }
private function filterRecurrences(Collection $recurrences): Collection private function filterRecurrences(Collection $recurrences): Collection
@@ -414,6 +415,9 @@ class CreateRecurringTransactions implements ShouldQueue
$transactions->first(); $transactions->first();
$return = []; $return = [];
/** @var RecurrenceTransaction $transaction */ /** @var RecurrenceTransaction $transaction */
foreach ($transactions as $index => $transaction) { foreach ($transactions as $index => $transaction) {
$single = [ $single = [

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Notifications; namespace FireflyIII\Notifications;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Support\Notifications\UrlValidator; use FireflyIII\Support\Notifications\UrlValidator;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
@@ -94,7 +95,7 @@ class ReturnsAvailableChannels
$channels = ['mail']; $channels = ['mail'];
if (true === config('notifications.channels.slack.enabled', false)) { if (true === config('notifications.channels.slack.enabled', false)) {
$slackUrl = (string) app('preferences')->getEncryptedForUser($user, 'slack_webhook_url', '')->data; $slackUrl = (string) Preferences::getEncryptedForUser($user, 'slack_webhook_url', '')->data;
if (UrlValidator::isValidWebhookURL($slackUrl)) { if (UrlValidator::isValidWebhookURL($slackUrl)) {
$channels[] = 'slack'; $channels[] = 'slack';
} }
@@ -102,20 +103,20 @@ class ReturnsAvailableChannels
// // validate presence of of Ntfy settings. // // validate presence of of Ntfy settings.
// if (true === config('notifications.channels.nfy.enabled', false)) { // if (true === config('notifications.channels.nfy.enabled', false)) {
// $ntfyTopic = (string) app('preferences')->getEncryptedForUser($user, 'ntfy_topic', '')->data; // $ntfyTopic = (string) \FireflyIII\Support\Facades\Preferences::getEncryptedForUser($user, 'ntfy_topic', '')->data;
// if ('' !== $ntfyTopic) { // if ('' !== $ntfyTopic) {
// Log::debug(sprintf('Enabled ntfy, "%s"', $ntfyTopic)); // Log::debug(sprintf('Enabled ntfy, "%s"', $ntfyTopic));
// $channels[] = NtfyChannel::class; // $channels[] = NtfyChannel::class;
// } // }
// if ('' === (string) app('preferences')->getEncryptedForUser($user, 'ntfy_topic', '')->data) { // if ('' === (string) \FireflyIII\Support\Facades\Preferences::getEncryptedForUser($user, 'ntfy_topic', '')->data) {
// Log::warning('No topic name for Ntfy, channel is disabled.'); // Log::warning('No topic name for Ntfy, channel is disabled.');
// } // }
// } // }
// pushover // pushover
if (true === config('notifications.channels.slack.enabled', false)) { if (true === config('notifications.channels.slack.enabled', false)) {
$pushoverAppToken = (string) app('preferences')->getEncryptedForUser($user, 'pushover_app_token', '')->data; $pushoverAppToken = (string) Preferences::getEncryptedForUser($user, 'pushover_app_token', '')->data;
$pushoverUserToken = (string) app('preferences')->getEncryptedForUser($user, 'pushover_user_token', '')->data; $pushoverUserToken = (string) Preferences::getEncryptedForUser($user, 'pushover_user_token', '')->data;
if ('' === $pushoverAppToken || '' === $pushoverUserToken) { if ('' === $pushoverAppToken || '' === $pushoverUserToken) {
Log::warning('[b] No Pushover token, channel is disabled.'); Log::warning('[b] No Pushover token, channel is disabled.');
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Repositories\Recurring; namespace FireflyIII\Repositories\Recurring;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Factory\RecurrenceFactory; use FireflyIII\Factory\RecurrenceFactory;
@@ -436,7 +437,7 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte
Log::debug('Now in repetitionDescription()'); Log::debug('Now in repetitionDescription()');
/** @var Preference $pref */ /** @var Preference $pref */
$pref = app('preferences')->getForUser($this->user, 'language', config('firefly.default_language', 'en_US')); $pref = Preferences::getForUser($this->user, 'language', config('firefly.default_language', 'en_US'));
$language = $pref->data; $language = $pref->data;
if (is_array($language)) { if (is_array($language)) {
$language = 'en_US'; $language = 'en_US';

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Repositories\User; namespace FireflyIII\Repositories\User;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Carbon\Carbon; use Carbon\Carbon;
use Exception; use Exception;
@@ -57,12 +58,12 @@ class UserRepository implements UserRepositoryInterface
$oldEmail = $user->email; $oldEmail = $user->email;
// save old email as pref // save old email as pref
app('preferences')->setForUser($user, 'previous_email_latest', $oldEmail); Preferences::setForUser($user, 'previous_email_latest', $oldEmail);
app('preferences')->setForUser($user, 'previous_email_'.Carbon::now()->format('Y-m-d-H-i-s'), $oldEmail); Preferences::setForUser($user, 'previous_email_'.Carbon::now()->format('Y-m-d-H-i-s'), $oldEmail);
// set undo and confirm token: // set undo and confirm token:
app('preferences')->setForUser($user, 'email_change_undo_token', bin2hex(random_bytes(16))); Preferences::setForUser($user, 'email_change_undo_token', bin2hex(random_bytes(16)));
app('preferences')->setForUser($user, 'email_change_confirm_token', bin2hex(random_bytes(16))); Preferences::setForUser($user, 'email_change_confirm_token', bin2hex(random_bytes(16)));
// update user // update user
$user->email = $newEmail; $user->email = $newEmail;
@@ -367,8 +368,8 @@ class UserRepository implements UserRepositoryInterface
$oldEmail = $user->email; $oldEmail = $user->email;
// save old email as pref // save old email as pref
app('preferences')->setForUser($user, 'admin_previous_email_latest', $oldEmail); Preferences::setForUser($user, 'admin_previous_email_latest', $oldEmail);
app('preferences')->setForUser($user, 'admin_previous_email_'.Carbon::now()->format('Y-m-d-H-i-s'), $oldEmail); Preferences::setForUser($user, 'admin_previous_email_'.Carbon::now()->format('Y-m-d-H-i-s'), $oldEmail);
$user->email = $newEmail; $user->email = $newEmail;
$user->save(); $user->save();

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Services\Internal\Support; namespace FireflyIII\Services\Internal\Support;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Carbon\Carbon; use Carbon\Carbon;
use Deprecated; use Deprecated;
@@ -193,7 +194,7 @@ trait AccountServiceTrait
protected function createOBGroup(Account $account, array $data): TransactionGroup protected function createOBGroup(Account $account, array $data): TransactionGroup
{ {
Log::debug('Now going to create an OB group.'); Log::debug('Now going to create an OB group.');
$language = app('preferences')->getForUser($account->user, 'language', 'en_US')->data; $language = Preferences::getForUser($account->user, 'language', 'en_US')->data;
if (is_array($language)) { if (is_array($language)) {
$language = 'en_US'; $language = 'en_US';
} }
@@ -425,7 +426,7 @@ trait AccountServiceTrait
throw new FireflyException('Amount for new liability credit was unexpectedly 0.'); throw new FireflyException('Amount for new liability credit was unexpectedly 0.');
} }
$language = app('preferences')->getForUser($account->user, 'language', 'en_US')->data; $language = Preferences::getForUser($account->user, 'language', 'en_US')->data;
if (is_array($language)) { if (is_array($language)) {
$language = 'en_US'; $language = 'en_US';
} }
@@ -615,7 +616,7 @@ trait AccountServiceTrait
protected function createOBGroupV2(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup protected function createOBGroupV2(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
{ {
Log::debug('Now going to create an OB group.'); Log::debug('Now going to create an OB group.');
$language = app('preferences')->getForUser($account->user, 'language', 'en_US')->data; $language = Preferences::getForUser($account->user, 'language', 'en_US')->data;
if (is_array($language)) { if (is_array($language)) {
$language = 'en_US'; $language = 'en_US';
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Services\Internal\Update; namespace FireflyIII\Services\Internal\Update;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Events\UpdatedAccount; use FireflyIII\Events\UpdatedAccount;
@@ -291,7 +292,7 @@ class AccountUpdateService
if (true === $account->active) { if (true === $account->active) {
return; return;
} }
$preference = app('preferences')->getForUser($account->user, 'frontpageAccounts'); $preference = Preferences::getForUser($account->user, 'frontpageAccounts');
if (null === $preference) { if (null === $preference) {
return; return;
} }
@@ -310,6 +311,6 @@ class AccountUpdateService
} }
} }
Log::debug('Final new array is', $new); Log::debug('Final new array is', $new);
app('preferences')->setForUser($account->user, 'frontpageAccounts', $new); Preferences::setForUser($account->user, 'frontpageAccounts', $new);
} }
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Services\Internal\Update; namespace FireflyIII\Services\Internal\Update;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Events\TriggeredAuditLog; use FireflyIII\Events\TriggeredAuditLog;
use FireflyIII\Exceptions\DuplicateTransactionException; use FireflyIII\Exceptions\DuplicateTransactionException;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
@@ -83,7 +84,7 @@ class GroupUpdateService
$this->updateTransactionJournal($transactionGroup, $first, reset($transactions)); $this->updateTransactionJournal($transactionGroup, $first, reset($transactions));
$transactionGroup->touch(); $transactionGroup->touch();
$transactionGroup->refresh(); $transactionGroup->refresh();
app('preferences')->mark(); Preferences::mark();
return $transactionGroup; return $transactionGroup;
} }
@@ -98,7 +99,7 @@ class GroupUpdateService
Log::error('There were no transactions updated or created. Will not delete anything.'); Log::error('There were no transactions updated or created. Will not delete anything.');
$transactionGroup->touch(); $transactionGroup->touch();
$transactionGroup->refresh(); $transactionGroup->refresh();
app('preferences')->mark(); Preferences::mark();
return $transactionGroup; return $transactionGroup;
} }
@@ -116,7 +117,7 @@ class GroupUpdateService
$service->destroy($journal); $service->destroy($journal);
} }
app('preferences')->mark(); Preferences::mark();
$transactionGroup->touch(); $transactionGroup->touch();
$transactionGroup->refresh(); $transactionGroup->refresh();

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Services\Internal\Update; namespace FireflyIII\Services\Internal\Update;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use Carbon\Exceptions\InvalidDateException; use Carbon\Exceptions\InvalidDateException;
use Carbon\Exceptions\InvalidFormatException; use Carbon\Exceptions\InvalidFormatException;
@@ -165,7 +166,7 @@ class JournalUpdateService
$this->updateAmount(); $this->updateAmount();
$this->updateForeignAmount(); $this->updateForeignAmount();
app('preferences')->mark(); Preferences::mark();
$this->transactionJournal->refresh(); $this->transactionJournal->refresh();
Log::debug('Done with update journal routine'); Log::debug('Done with update journal routine');

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Support\Binder; namespace FireflyIII\Support\Binder;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface;
use Illuminate\Routing\Route; use Illuminate\Routing\Route;
@@ -46,7 +47,7 @@ class CLIToken implements BinderInterface
} }
foreach ($users as $user) { foreach ($users as $user) {
$accessToken = app('preferences')->getForUser($user, 'access_token'); $accessToken = Preferences::getForUser($user, 'access_token');
if (null !== $accessToken && $accessToken->data === $value) { if (null !== $accessToken && $accessToken->data === $value) {
Log::info(sprintf('Recognized user #%d (%s) from his access token.', $user->id, $user->email)); Log::info(sprintf('Recognized user #%d (%s) from his access token.', $user->id, $user->email));

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Support; namespace FireflyIII\Support;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Support\Facades\Steam; use FireflyIII\Support\Facades\Steam;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
@@ -44,7 +45,7 @@ class CacheProperties
$this->properties = new Collection(); $this->properties = new Collection();
if (auth()->check()) { if (auth()->check()) {
$this->addProperty(auth()->user()->id); $this->addProperty(auth()->user()->id);
$this->addProperty(app('preferences')->lastActivity()); $this->addProperty(Preferences::lastActivity());
$this->addProperty(Steam::anonymous()); $this->addProperty(Steam::anonymous());
} }
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Support\Cronjobs; namespace FireflyIII\Support\Cronjobs;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Jobs\CreateAutoBudgetLimits; use FireflyIII\Jobs\CreateAutoBudgetLimits;
use FireflyIII\Models\Configuration; use FireflyIII\Models\Configuration;
@@ -62,7 +63,7 @@ class AutoBudgetCronjob extends AbstractCronjob
} }
$this->fireAutoBudget(); $this->fireAutoBudget();
app('preferences')->mark(); Preferences::mark();
} }
private function fireAutoBudget(): void private function fireAutoBudget(): void

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Support\Cronjobs; namespace FireflyIII\Support\Cronjobs;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Jobs\WarnAboutBills; use FireflyIII\Jobs\WarnAboutBills;
@@ -74,7 +75,7 @@ class BillWarningCronjob extends AbstractCronjob
$this->fireWarnings(); $this->fireWarnings();
app('preferences')->mark(); Preferences::mark();
} }
private function fireWarnings(): void private function fireWarnings(): void

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Support\Cronjobs; namespace FireflyIII\Support\Cronjobs;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Jobs\DownloadExchangeRates; use FireflyIII\Jobs\DownloadExchangeRates;
use FireflyIII\Models\Configuration; use FireflyIII\Models\Configuration;
@@ -63,7 +64,7 @@ class ExchangeRatesCronjob extends AbstractCronjob
} }
$this->fireExchangeRateJob(); $this->fireExchangeRateJob();
app('preferences')->mark(); Preferences::mark();
} }
private function fireExchangeRateJob(): void private function fireExchangeRateJob(): void

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Support\Cronjobs; namespace FireflyIII\Support\Cronjobs;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Jobs\CreateRecurringTransactions; use FireflyIII\Jobs\CreateRecurringTransactions;
@@ -73,7 +74,7 @@ class RecurringCronjob extends AbstractCronjob
$this->fireRecurring(); $this->fireRecurring();
app('preferences')->mark(); Preferences::mark();
} }
private function fireRecurring(): void private function fireRecurring(): void

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Support\Cronjobs; namespace FireflyIII\Support\Cronjobs;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Events\RequestedSendWebhookMessages; use FireflyIII\Events\RequestedSendWebhookMessages;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
@@ -74,7 +75,7 @@ class WebhookCronjob extends AbstractCronjob
$this->fireWebhookmessages(); $this->fireWebhookmessages();
app('preferences')->mark(); Preferences::mark();
} }
private function fireWebhookmessages(): void private function fireWebhookmessages(): void

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Support\Http\Api; namespace FireflyIII\Support\Http\Api;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\AccountTypeEnum;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
@@ -53,7 +54,7 @@ trait CollectsAccountsFromFilter
// if no preselected, but no accounts: // if no preselected, but no accounts:
if ('empty' === $queryParameters['preselected'] && 0 === $collection->count()) { if ('empty' === $queryParameters['preselected'] && 0 === $collection->count()) {
$defaultSet = $this->repository->getAccountsByType([AccountTypeEnum::ASSET->value, AccountTypeEnum::DEFAULT->value])->pluck('id')->toArray(); $defaultSet = $this->repository->getAccountsByType([AccountTypeEnum::ASSET->value, AccountTypeEnum::DEFAULT->value])->pluck('id')->toArray();
$frontpage = app('preferences')->get('frontpageAccounts', $defaultSet); $frontpage = Preferences::get('frontpageAccounts', $defaultSet);
if (!(is_array($frontpage->data) && count($frontpage->data) > 0)) { if (!(is_array($frontpage->data) && count($frontpage->data) > 0)) {
$frontpage->data = $defaultSet; $frontpage->data = $defaultSet;

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Support\Http\Controllers; namespace FireflyIII\Support\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Exceptions\ValidationException; use FireflyIII\Exceptions\ValidationException;
use FireflyIII\Http\Requests\RuleFormRequest; use FireflyIII\Http\Requests\RuleFormRequest;
@@ -110,7 +111,7 @@ trait RequestInformation
$shownDemo = true; $shownDemo = true;
// both must be array and either must be > 0 // both must be array and either must be > 0
if (count($intro) > 0 || count($specialIntro) > 0) { if (count($intro) > 0 || count($specialIntro) > 0) {
$shownDemo = app('preferences')->get($key, false)->data; $shownDemo = Preferences::get($key, false)->data;
} }
if (!is_bool($shownDemo)) { if (!is_bool($shownDemo)) {
return true; return true;

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Support; namespace FireflyIII\Support;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Exceptions\IntervalException; use FireflyIII\Exceptions\IntervalException;
@@ -381,7 +382,7 @@ class Navigation
*/ */
public function getViewRange(bool $correct): string public function getViewRange(bool $correct): string
{ {
$range = app('preferences')->get('viewRange', '1M')->data ?? '1M'; $range = Preferences::get('viewRange', '1M')->data ?? '1M';
if (is_array($range)) { if (is_array($range)) {
$range = '1M'; $range = '1M';
} }

View File

@@ -25,6 +25,7 @@ declare(strict_types=1);
namespace FireflyIII\Support\Observers; namespace FireflyIII\Support\Observers;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Models\AvailableBudget; use FireflyIII\Models\AvailableBudget;
use FireflyIII\Models\Budget; use FireflyIII\Models\Budget;
use FireflyIII\Models\BudgetLimit; use FireflyIII\Models\BudgetLimit;
@@ -161,7 +162,7 @@ trait RecalculatesAvailableBudgetsTrait
// either overlap multiple available budget periods or be contained in a single one. // either overlap multiple available budget periods or be contained in a single one.
// all have to be created or updated. // all have to be created or updated.
try { try {
$viewRange = app('preferences')->getForUser($user, 'viewRange', '1M')->data; $viewRange = Preferences::getForUser($user, 'viewRange', '1M')->data;
} catch (ContainerExceptionInterface|NotFoundExceptionInterface $e) { } catch (ContainerExceptionInterface|NotFoundExceptionInterface $e) {
Log::error($e->getMessage()); Log::error($e->getMessage());
$viewRange = '1M'; $viewRange = '1M';

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Support\Search; namespace FireflyIII\Support\Search;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Enums\SearchDirection; use FireflyIII\Enums\SearchDirection;
@@ -238,7 +239,7 @@ class OperatorQuerySearch implements SearchInterface
$this->collector->setUser($user); $this->collector->setUser($user);
$this->collector->withAccountInformation()->withCategoryInformation()->withBudgetInformation(); $this->collector->withAccountInformation()->withCategoryInformation()->withBudgetInformation();
$this->setLimit((int)app('preferences')->getForUser($user, 'listPageSize', 50)->data); $this->setLimit((int)Preferences::getForUser($user, 'listPageSize', 50)->data);
} }
private function findCurrency(string $value): ?TransactionCurrency private function findCurrency(string $value): ?TransactionCurrency

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Support; namespace FireflyIII\Support;
use FireflyIII\Support\Facades\Preferences;
use Deprecated; use Deprecated;
use Carbon\Carbon; use Carbon\Carbon;
use Exception; use Exception;
@@ -573,7 +574,7 @@ class Steam
*/ */
public function getLanguage(): string // get preference public function getLanguage(): string // get preference
{ {
$preference = app('preferences')->get('language', config('firefly.default_language', 'en_US'))->data; $preference = Preferences::get('language', config('firefly.default_language', 'en_US'))->data;
if (!is_string($preference)) { if (!is_string($preference)) {
throw new FireflyException(sprintf('Preference "language" must be a string, but is unexpectedly a "%s".', gettype($preference))); throw new FireflyException(sprintf('Preference "language" must be a string, but is unexpectedly a "%s".', gettype($preference)));
} }
@@ -611,7 +612,7 @@ class Steam
if (null !== $cached) { if (null !== $cached) {
return $cached; return $cached;
} }
$locale = app('preferences')->get('locale', config('firefly.default_locale', 'equal'))->data; $locale = Preferences::get('locale', config('firefly.default_locale', 'equal'))->data;
if (is_array($locale)) { if (is_array($locale)) {
$locale = 'equal'; $locale = 'equal';
} }
@@ -636,7 +637,7 @@ class Steam
if (null !== $cached) { if (null !== $cached) {
return $cached; return $cached;
} }
$anonymous = app('preferences')->get('anonymous', config('firefly.default_preferences.anonymous', false))->data; $anonymous = Preferences::get('anonymous', config('firefly.default_preferences.anonymous', false))->data;
$singleton->setPreference('anonymous', $anonymous); $singleton->setPreference('anonymous', $anonymous);
return $anonymous; return $anonymous;

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII; namespace FireflyIII;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use Deprecated; use Deprecated;
use Exception; use Exception;
@@ -357,7 +358,7 @@ class User extends Authenticatable
} }
$email = $this->email; $email = $this->email;
// see if user has alternative email address: // see if user has alternative email address:
$pref = app('preferences')->getForUser($this, 'remote_guard_alt_email'); $pref = Preferences::getForUser($this, 'remote_guard_alt_email');
if (null !== $pref) { if (null !== $pref) {
$email = $pref->data; $email = $pref->data;
} }
@@ -390,8 +391,8 @@ class User extends Authenticatable
public function routeNotificationForPushover(): PushoverReceiver public function routeNotificationForPushover(): PushoverReceiver
{ {
$appToken = (string) app('preferences')->getEncrypted('pushover_app_token', '')->data; $appToken = (string) Preferences::getEncrypted('pushover_app_token', '')->data;
$userToken = (string) app('preferences')->getEncrypted('pushover_user_token', '')->data; $userToken = (string) Preferences::getEncrypted('pushover_user_token', '')->data;
return PushoverReceiver::withUserKey($userToken)->withApplicationToken($appToken); return PushoverReceiver::withUserKey($userToken)->withApplicationToken($appToken);
} }
@@ -419,7 +420,7 @@ class User extends Authenticatable
if ($notification instanceof VersionCheckResult) { if ($notification instanceof VersionCheckResult) {
return $res; return $res;
} }
$pref = app('preferences')->getEncryptedForUser($this, 'slack_webhook_url', '')->data; $pref = Preferences::getEncryptedForUser($this, 'slack_webhook_url', '')->data;
if (is_array($pref)) { if (is_array($pref)) {
return ''; return '';
} }

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Validation; namespace FireflyIII\Validation;
use FireflyIII\Support\Facades\Preferences;
use Config; use Config;
use FireflyIII\Enums\AccountTypeEnum; use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
@@ -84,7 +85,7 @@ class FireflyValidator extends Validator
return false; return false;
} }
$secretPreference = app('preferences')->get('temp-mfa-secret'); $secretPreference = Preferences::get('temp-mfa-secret');
$secret = $secretPreference->data ?? ''; $secret = $secretPreference->data ?? '';
if (is_array($secret)) { if (is_array($secret)) {
$secret = ''; $secret = '';

View File

@@ -8,7 +8,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed ### Fixed
- [Discussion 11211](https://github.com/orgs/firefly-iii/discussions/11211) (question about Transaction journal ID) started by @zhiiwg - [Discussion 11211](https://github.com/orgs/firefly-iii/discussions/11211) (question about Transaction journal ID) started by @zhiiwg
- [Issue 11247](https://github.com/firefly-iii/firefly-iii/issues/11247) (Optional transaction information not saved when updating a recurring transaction.) reported by @Tommy78649
- [Issue 11267](https://github.com/firefly-iii/firefly-iii/issues/11267) (Tags can be added to elements that can't be removed) reported by @Fmstrat - [Issue 11267](https://github.com/firefly-iii/firefly-iii/issues/11267) (Tags can be added to elements that can't be removed) reported by @Fmstrat
- [Issue 11281](https://github.com/firefly-iii/firefly-iii/issues/11281) (Webhooks are triggered twice when recurring creates transaction on cronjob) reported by @MexerSam
- [Issue 11284](https://github.com/firefly-iii/firefly-iii/issues/11284) (500 Internal Server Error when deleting budget) reported by @jschollenberger
- [Issue 11288](https://github.com/firefly-iii/firefly-iii/issues/11288) (Piggy bank creation form doesn't respect primary currency) reported by @jschollenberger
- [Issue 11191](https://github.com/firefly-iii/firefly-iii/issues/11191) (Going beyond 6.4.2 displays wrong balance) reported by @The24KFool
### API ### API

602
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -78,8 +78,8 @@ return [
'running_balance_column' => env('USE_RUNNING_BALANCE', false), 'running_balance_column' => env('USE_RUNNING_BALANCE', false),
// see cer.php for exchange rates feature flag. // see cer.php for exchange rates feature flag.
], ],
'version' => 'develop/2025-11-26', 'version' => '6.4.9',
'build_time' => 1764180641, 'build_time' => 1764362024,
'api_version' => '2.1.0', // field is no longer used. 'api_version' => '2.1.0', // field is no longer used.
'db_version' => 28, // field is no longer used. 'db_version' => 28, // field is no longer used.

36
package-lock.json generated
View File

@@ -4075,9 +4075,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/baseline-browser-mapping": { "node_modules/baseline-browser-mapping": {
"version": "2.8.31", "version": "2.8.32",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.31.tgz", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.32.tgz",
"integrity": "sha512-a28v2eWrrRWPpJSzxc+mKwm0ZtVx/G8SepdQZDArnXYU/XS+IF6mp8aB/4E+hH1tyGCoDo3KlUCdlSxGDsRkAw==", "integrity": "sha512-OPz5aBThlyLFgxyhdwf/s2+8ab3OvT7AdTNvKHBwpXomIYeXqpUUuT8LrdtxZSsWJ4R4CU1un4XGh5Ez3nlTpw==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"bin": { "bin": {
@@ -5736,9 +5736,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.5.260", "version": "1.5.262",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.260.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.262.tgz",
"integrity": "sha512-ov8rBoOBhVawpzdre+Cmz4FB+y66Eqrk6Gwqd8NGxuhv99GQ8XqMAr351KEkOt7gukXWDg6gJWEMKgL2RLMPtA==", "integrity": "sha512-NlAsMteRHek05jRUxUR0a5jpjYq9ykk6+kO0yRaMi5moe7u0fVIOeQ3Y30A8dIiWFBNUoQGi1ljb1i5VtS9WQQ==",
"dev": true, "dev": true,
"license": "ISC" "license": "ISC"
}, },
@@ -5820,9 +5820,9 @@
} }
}, },
"node_modules/envinfo": { "node_modules/envinfo": {
"version": "7.20.0", "version": "7.21.0",
"resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.20.0.tgz", "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.21.0.tgz",
"integrity": "sha512-+zUomDcLXsVkQ37vUqWBvQwLaLlj8eZPSi61llaEFAVBY5mhcXdaSw1pSJVl4yTYD5g/gEfpNl28YYk4IPvrrg==", "integrity": "sha512-Lw7I8Zp5YKHFCXL7+Dz95g4CcbMEpgvqZNNq3AmlT5XAV6CgAAk6gyAMqn2zjw08K9BHfcNuKrMiCPLByGafow==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"bin": { "bin": {
@@ -7338,9 +7338,9 @@
} }
}, },
"node_modules/ipaddr.js": { "node_modules/ipaddr.js": {
"version": "2.2.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.3.0.tgz",
"integrity": "sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==", "integrity": "sha512-Zv/pA+ciVFbCSBBjGfaKUya/CcGmUHzTydLMaTwrUUEM2DIEO3iZvueGxmacvmN50fGpGVKeTXpb2LcYQxeVdg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -9313,9 +9313,9 @@
} }
}, },
"node_modules/postcss-modules-local-by-default/node_modules/postcss-selector-parser": { "node_modules/postcss-modules-local-by-default/node_modules/postcss-selector-parser": {
"version": "7.1.0", "version": "7.1.1",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.1.tgz",
"integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", "integrity": "sha512-orRsuYpJVw8LdAwqqLykBj9ecS5/cRHlI5+nvTo8LcCKmzDmqVORXtOIYEEQuL9D4BxtA1lm5isAqzQZCoQ6Eg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -9343,9 +9343,9 @@
} }
}, },
"node_modules/postcss-modules-scope/node_modules/postcss-selector-parser": { "node_modules/postcss-modules-scope/node_modules/postcss-selector-parser": {
"version": "7.1.0", "version": "7.1.1",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.1.tgz",
"integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", "integrity": "sha512-orRsuYpJVw8LdAwqqLykBj9ecS5/cRHlI5+nvTo8LcCKmzDmqVORXtOIYEEQuL9D4BxtA1lm5isAqzQZCoQ6Eg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {