mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-07 22:37:57 +00:00
Replace some setter methods by set()
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
7159bc68d3
commit
fc20e29988
3 changed files with 8 additions and 32 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ readonly class Setup {
|
|||
}
|
||||
|
||||
$password = $this->passwordGenerator->GeneratePassword(8);
|
||||
$this->configurationManager->SetPassword($password);
|
||||
$this->configurationManager->set('password', $password);
|
||||
return $password;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue