diff --git a/php/src/Controller/ConfigurationController.php b/php/src/Controller/ConfigurationController.php index 45586f9c..55026817 100644 --- a/php/src/Controller/ConfigurationController.php +++ b/php/src/Controller/ConfigurationController.php @@ -105,9 +105,9 @@ readonly class ConfigurationController { $this->configurationManager->SetTalkRecordingEnabledState(0); } if (isset($request->getParsedBody()['imaginary'])) { - $this->configurationManager->SetImaginaryEnabledState(1); + $this->configurationManager->set('isImaginaryEnabled', 1); } else { - $this->configurationManager->SetImaginaryEnabledState(0); + $this->configurationManager->set('isImaginaryEnabled', 0); } if (isset($request->getParsedBody()['fulltextsearch'])) { $this->configurationManager->SetFulltextsearchEnabledState(1); @@ -115,14 +115,14 @@ readonly class ConfigurationController { $this->configurationManager->SetFulltextsearchEnabledState(0); } if (isset($request->getParsedBody()['docker-socket-proxy'])) { - $this->configurationManager->SetDockerSocketProxyEnabledState(1); + $this->configurationManager->set('isDockerSocketProxyEnabled', 1); } else { - $this->configurationManager->SetDockerSocketProxyEnabledState(0); + $this->configurationManager->set('isDockerSocketProxyEnabled', 0); } if (isset($request->getParsedBody()['whiteboard'])) { - $this->configurationManager->SetWhiteboardEnabledState(1); + $this->configurationManager->set('isWhiteboardEnabled', 1); } else { - $this->configurationManager->SetWhiteboardEnabledState(0); + $this->configurationManager->set('isWhiteboardEnabled', 0); } } diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index 678cfbe4..9a75baca 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -40,12 +40,6 @@ class ConfigurationManager return $this->GetConfig()['AIO_TOKEN']; } - public function SetPassword(string $password) : void { - $config = $this->GetConfig(); - $config['password'] = $password; - $this->WriteConfig($config); - } - public function GetAndGenerateSecret(string $secretId) : string { if ($secretId === '') { return ''; @@ -168,12 +162,6 @@ class ConfigurationManager } } - public function SetDockerSocketProxyEnabledState(int $value) : void { - $config = $this->GetConfig(); - $config['isDockerSocketProxyEnabled'] = $value; - $this->WriteConfig($config); - } - public function isWhiteboardEnabled() : bool { $config = $this->GetConfig(); if (isset($config['isWhiteboardEnabled']) && $config['isWhiteboardEnabled'] === 0) { @@ -183,12 +171,6 @@ class ConfigurationManager } } - public function SetWhiteboardEnabledState(int $value) : void { - $config = $this->GetConfig(); - $config['isWhiteboardEnabled'] = $value; - $this->WriteConfig($config); - } - public function SetClamavEnabledState(int $value) : void { $config = $this->GetConfig(); $config['isClamavEnabled'] = $value; @@ -204,12 +186,6 @@ class ConfigurationManager } } - public function SetImaginaryEnabledState(int $value) : void { - $config = $this->GetConfig(); - $config['isImaginaryEnabled'] = $value; - $this->WriteConfig($config); - } - public function isFulltextsearchEnabled() : bool { $config = $this->GetConfig(); if (isset($config['isFulltextsearchEnabled']) && $config['isFulltextsearchEnabled'] === 1) { @@ -582,7 +558,7 @@ class ConfigurationManager } // All checks pass so set the password - $this->SetPassword($newPassword); + $this->set('password', $newPassword); } public function GetApachePort() : string { diff --git a/php/src/Data/Setup.php b/php/src/Data/Setup.php index f8f43e4b..80ffa655 100644 --- a/php/src/Data/Setup.php +++ b/php/src/Data/Setup.php @@ -17,7 +17,7 @@ readonly class Setup { } $password = $this->passwordGenerator->GeneratePassword(8); - $this->configurationManager->SetPassword($password); + $this->configurationManager->set('password', $password); return $password; }