mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-04 04:56:52 +00:00
Make isOnlyofficeEnabled an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
f8a244bee2
commit
0c3d919618
5 changed files with 12 additions and 23 deletions
|
|
@ -111,7 +111,7 @@ $app->get('/containers', function (Request $request, Response $response, array $
|
|||
'backup_times' => $configurationManager->GetBackupTimes(),
|
||||
'current_channel' => $dockerActionManager->GetCurrentChannel(),
|
||||
'is_clamav_enabled' => $configurationManager->isClamavEnabled,
|
||||
'is_onlyoffice_enabled' => $configurationManager->isOnlyofficeEnabled(),
|
||||
'is_onlyoffice_enabled' => $configurationManager->isOnlyofficeEnabled,
|
||||
'is_collabora_enabled' => $configurationManager->isCollaboraEnabled(),
|
||||
'is_talk_enabled' => $configurationManager->isTalkEnabled(),
|
||||
'borg_restore_password' => $configurationManager->GetBorgRestorePassword(),
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ readonly class ContainerDefinitionFetcher {
|
|||
continue;
|
||||
}
|
||||
} elseif ($entry['container_name'] === 'nextcloud-aio-onlyoffice') {
|
||||
if (!$this->configurationManager->isOnlyofficeEnabled()) {
|
||||
if (!$this->configurationManager->isOnlyofficeEnabled) {
|
||||
continue;
|
||||
}
|
||||
} elseif ($entry['container_name'] === 'nextcloud-aio-collabora') {
|
||||
|
|
@ -172,7 +172,7 @@ readonly class ContainerDefinitionFetcher {
|
|||
continue;
|
||||
}
|
||||
} elseif ($value === 'nextcloud-aio-onlyoffice') {
|
||||
if (!$this->configurationManager->isOnlyofficeEnabled()) {
|
||||
if (!$this->configurationManager->isOnlyofficeEnabled) {
|
||||
continue;
|
||||
}
|
||||
} elseif ($value === 'nextcloud-aio-collabora') {
|
||||
|
|
|
|||
|
|
@ -80,16 +80,15 @@ readonly class ConfigurationController {
|
|||
|
||||
if ($officeSuiteChoice === 'collabora') {
|
||||
$this->configurationManager->SetCollaboraEnabledState(1);
|
||||
$this->configurationManager->SetOnlyofficeEnabledState(0);
|
||||
$this->configurationManager->isOnlyofficeEnabled = false;
|
||||
} elseif ($officeSuiteChoice === 'onlyoffice') {
|
||||
$this->configurationManager->SetCollaboraEnabledState(0);
|
||||
$this->configurationManager->SetOnlyofficeEnabledState(1);
|
||||
$this->configurationManager->isOnlyofficeEnabled = true;
|
||||
} else {
|
||||
$this->configurationManager->SetCollaboraEnabledState(0);
|
||||
$this->configurationManager->SetOnlyofficeEnabledState(0);
|
||||
$this->configurationManager->isOnlyofficeEnabled = false;
|
||||
}
|
||||
$this->configurationManager->isClamavEnabled = isset($request->getParsedBody()['clamav']);
|
||||
}
|
||||
if (isset($request->getParsedBody()['talk'])) {
|
||||
$this->configurationManager->SetTalkEnabledState(1);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -73,6 +73,11 @@ class ConfigurationManager
|
|||
set { $this->set('isClamavEnabled', $value); }
|
||||
}
|
||||
|
||||
public bool $isOnlyofficeEnabled {
|
||||
get => $this->get('isOnlyofficeEnabled', false);
|
||||
set { $this->set('isOnlyofficeEnabled', $value); }
|
||||
}
|
||||
|
||||
public function GetConfig() : array
|
||||
{
|
||||
if ($this->config === [] && file_exists(DataConst::GetConfigFile()))
|
||||
|
|
@ -243,21 +248,6 @@ class ConfigurationManager
|
|||
$this->WriteConfig($config);
|
||||
}
|
||||
|
||||
public function isOnlyofficeEnabled() : bool {
|
||||
$config = $this->GetConfig();
|
||||
if (isset($config['isOnlyofficeEnabled']) && $config['isOnlyofficeEnabled'] === 1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function SetOnlyofficeEnabledState(int $value) : void {
|
||||
$config = $this->GetConfig();
|
||||
$config['isOnlyofficeEnabled'] = $value;
|
||||
$this->WriteConfig($config);
|
||||
}
|
||||
|
||||
public function isCollaboraEnabled() : bool {
|
||||
$config = $this->GetConfig();
|
||||
if (isset($config['isCollaboraEnabled']) && $config['isCollaboraEnabled'] === 0) {
|
||||
|
|
|
|||
|
|
@ -573,7 +573,7 @@ readonly class DockerActionManager {
|
|||
'BACKUP_RESTORE_PASSWORD' => $this->configurationManager->GetBorgRestorePassword(),
|
||||
'CLAMAV_ENABLED' => $this->configurationManager->isClamavEnabled ? 'yes' : '',
|
||||
'TALK_RECORDING_ENABLED' => $this->configurationManager->isTalkRecordingEnabled() ? 'yes' : '',
|
||||
'ONLYOFFICE_ENABLED' => $this->configurationManager->isOnlyofficeEnabled() ? 'yes' : '',
|
||||
'ONLYOFFICE_ENABLED' => $this->configurationManager->isOnlyofficeEnabled ? 'yes' : '',
|
||||
'COLLABORA_ENABLED' => $this->configurationManager->isCollaboraEnabled() ? 'yes' : '',
|
||||
'TALK_ENABLED' => $this->configurationManager->isTalkEnabled() ? 'yes' : '',
|
||||
'UPDATE_NEXTCLOUD_APPS' => ($this->configurationManager->isDailyBackupRunning() && $this->configurationManager->areAutomaticUpdatesEnabled()) ? 'yes' : '',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue