From 4329b603a0a40ebb8c6e17ffa0ef53bcc88f166a Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 15 May 2024 13:15:04 +0200 Subject: [PATCH] fix: [settings] make sure they are always loaded --- src/Controller/AppController.php | 3 +++ src/Model/Table/SettingsTable.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Controller/AppController.php b/src/Controller/AppController.php index e095561..0b6aaa3 100644 --- a/src/Controller/AppController.php +++ b/src/Controller/AppController.php @@ -101,12 +101,15 @@ class AppController extends Controller public function beforeFilter(EventInterface $event) { + $this->loadModel('Settings'); + $this->Settings->loadSettings(); $this->loadModel('Users'); $this->Users->checkForNewInstance(); if ($this->ParamHandler->isRest()) { $this->authApiUser(); $this->Security->setConfig('unlockedActions', [$this->request->getParam('action')]); } + $this->ACL->setPublicInterfaces(); if (!empty($this->request->getAttribute('identity'))) { $user = $this->Users->get($this->request->getAttribute('identity')->getIdentifier(), [ diff --git a/src/Model/Table/SettingsTable.php b/src/Model/Table/SettingsTable.php index 2eb941c..ad35c05 100644 --- a/src/Model/Table/SettingsTable.php +++ b/src/Model/Table/SettingsTable.php @@ -126,7 +126,7 @@ class SettingsTable extends AppTable return $settings; } - private function loadSettings(): void + public function loadSettings(): void { $settings = file_get_contents(CONFIG . 'config.json'); $settings = json_decode($settings, true);