fix: [settings] make sure they are always loaded
parent
eae074ef73
commit
4329b603a0
|
@ -101,12 +101,15 @@ class AppController extends Controller
|
||||||
|
|
||||||
public function beforeFilter(EventInterface $event)
|
public function beforeFilter(EventInterface $event)
|
||||||
{
|
{
|
||||||
|
$this->loadModel('Settings');
|
||||||
|
$this->Settings->loadSettings();
|
||||||
$this->loadModel('Users');
|
$this->loadModel('Users');
|
||||||
$this->Users->checkForNewInstance();
|
$this->Users->checkForNewInstance();
|
||||||
if ($this->ParamHandler->isRest()) {
|
if ($this->ParamHandler->isRest()) {
|
||||||
$this->authApiUser();
|
$this->authApiUser();
|
||||||
$this->Security->setConfig('unlockedActions', [$this->request->getParam('action')]);
|
$this->Security->setConfig('unlockedActions', [$this->request->getParam('action')]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->ACL->setPublicInterfaces();
|
$this->ACL->setPublicInterfaces();
|
||||||
if (!empty($this->request->getAttribute('identity'))) {
|
if (!empty($this->request->getAttribute('identity'))) {
|
||||||
$user = $this->Users->get($this->request->getAttribute('identity')->getIdentifier(), [
|
$user = $this->Users->get($this->request->getAttribute('identity')->getIdentifier(), [
|
||||||
|
|
|
@ -126,7 +126,7 @@ class SettingsTable extends AppTable
|
||||||
return $settings;
|
return $settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function loadSettings(): void
|
public function loadSettings(): void
|
||||||
{
|
{
|
||||||
$settings = file_get_contents(CONFIG . 'config.json');
|
$settings = file_get_contents(CONFIG . 'config.json');
|
||||||
$settings = json_decode($settings, true);
|
$settings = json_decode($settings, true);
|
||||||
|
|
Loading…
Reference in New Issue