Replace references to hard coded config with variables.

This commit is contained in:
James Cole
2025-12-20 07:00:53 +01:00
parent 0f0cdb8e96
commit 8e729d6bbf
36 changed files with 51 additions and 50 deletions

View File

@@ -72,7 +72,7 @@ class ShowController extends Controller
*/
public function index(): JsonResponse
{
if (false === config('firefly.allow_webhooks')) {
if (false === \FireflyIII\Support\Facades\FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data) {
Log::channel('audit')->info('User tries to view all webhooks, but webhooks are DISABLED.');
throw new NotFoundHttpException('Webhooks are not enabled.');
@@ -114,7 +114,7 @@ class ShowController extends Controller
*/
public function show(Webhook $webhook): JsonResponse
{
if (false === config('firefly.allow_webhooks')) {
if (false === \FireflyIII\Support\Facades\FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data) {
Log::channel('audit')->info(sprintf('User tries to view webhook #%d, but webhooks are DISABLED.', $webhook->id));
throw new NotFoundHttpException('Webhooks are not enabled.');
@@ -146,7 +146,7 @@ class ShowController extends Controller
*/
public function triggerTransaction(Webhook $webhook, TransactionGroup $group): JsonResponse
{
if (false === config('firefly.allow_webhooks')) {
if (false === \FireflyIII\Support\Facades\FireflyConfig::get('allow_webhooks', config('firefly.allow_webhooks'))->data) {
Log::channel('audit')->info(sprintf('User tries to trigger webhook #%d on transaction group #%d, but webhooks are DISABLED.', $webhook->id, $group->id));
throw new NotFoundHttpException('Webhooks are not enabled.');