mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-15 10:10:17 +00:00
Make isOnlyofficeEnabled an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
1013cb02fd
commit
2c7f32c4d4
5 changed files with 10 additions and 24 deletions
|
|
@ -111,7 +111,7 @@ $app->get('/containers', function (Request $request, Response $response, array $
|
||||||
'backup_times' => $configurationManager->GetBackupTimes(),
|
'backup_times' => $configurationManager->GetBackupTimes(),
|
||||||
'current_channel' => $dockerActionManager->GetCurrentChannel(),
|
'current_channel' => $dockerActionManager->GetCurrentChannel(),
|
||||||
'is_clamav_enabled' => $configurationManager->isClamavEnabled,
|
'is_clamav_enabled' => $configurationManager->isClamavEnabled,
|
||||||
'is_onlyoffice_enabled' => $configurationManager->isOnlyofficeEnabled(),
|
'is_onlyoffice_enabled' => $configurationManager->isOnlyofficeEnabled,
|
||||||
'is_collabora_enabled' => $configurationManager->isCollaboraEnabled(),
|
'is_collabora_enabled' => $configurationManager->isCollaboraEnabled(),
|
||||||
'is_talk_enabled' => $configurationManager->isTalkEnabled(),
|
'is_talk_enabled' => $configurationManager->isTalkEnabled(),
|
||||||
'borg_restore_password' => $configurationManager->GetBorgRestorePassword(),
|
'borg_restore_password' => $configurationManager->GetBorgRestorePassword(),
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ readonly class ContainerDefinitionFetcher {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} elseif ($entry['container_name'] === 'nextcloud-aio-onlyoffice') {
|
} elseif ($entry['container_name'] === 'nextcloud-aio-onlyoffice') {
|
||||||
if (!$this->configurationManager->isOnlyofficeEnabled()) {
|
if (!$this->configurationManager->isOnlyofficeEnabled) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} elseif ($entry['container_name'] === 'nextcloud-aio-collabora') {
|
} elseif ($entry['container_name'] === 'nextcloud-aio-collabora') {
|
||||||
|
|
@ -172,7 +172,7 @@ readonly class ContainerDefinitionFetcher {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} elseif ($value === 'nextcloud-aio-onlyoffice') {
|
} elseif ($value === 'nextcloud-aio-onlyoffice') {
|
||||||
if (!$this->configurationManager->isOnlyofficeEnabled()) {
|
if (!$this->configurationManager->isOnlyofficeEnabled) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} elseif ($value === 'nextcloud-aio-collabora') {
|
} elseif ($value === 'nextcloud-aio-collabora') {
|
||||||
|
|
|
||||||
|
|
@ -80,11 +80,7 @@ readonly class ConfigurationController {
|
||||||
throw new InvalidSettingConfigurationException("Collabora and Onlyoffice are not allowed to be enabled at the same time!");
|
throw new InvalidSettingConfigurationException("Collabora and Onlyoffice are not allowed to be enabled at the same time!");
|
||||||
}
|
}
|
||||||
$this->configurationManager->isClamavEnabled = isset($request->getParsedBody()['clamav']);
|
$this->configurationManager->isClamavEnabled = isset($request->getParsedBody()['clamav']);
|
||||||
if (isset($request->getParsedBody()['onlyoffice'])) {
|
$this->configurationManager->isOnlyofficeEnabled = isset($request->getParsedBody()['onlyoffice']);
|
||||||
$this->configurationManager->SetOnlyofficeEnabledState(1);
|
|
||||||
} else {
|
|
||||||
$this->configurationManager->SetOnlyofficeEnabledState(0);
|
|
||||||
}
|
|
||||||
if (isset($request->getParsedBody()['collabora'])) {
|
if (isset($request->getParsedBody()['collabora'])) {
|
||||||
$this->configurationManager->SetCollaboraEnabledState(1);
|
$this->configurationManager->SetCollaboraEnabledState(1);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,11 @@ class ConfigurationManager
|
||||||
set { $this->set('isClamavEnabled', $value); }
|
set { $this->set('isClamavEnabled', $value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool $isOnlyofficeEnabled {
|
||||||
|
get => $this->get('isOnlyofficeEnabled', false);
|
||||||
|
set { $this->set('isOnlyofficeEnabled', $value); }
|
||||||
|
}
|
||||||
|
|
||||||
public function GetConfig() : array
|
public function GetConfig() : array
|
||||||
{
|
{
|
||||||
if ($this->config === [] && file_exists(DataConst::GetConfigFile()))
|
if ($this->config === [] && file_exists(DataConst::GetConfigFile()))
|
||||||
|
|
@ -243,21 +248,6 @@ class ConfigurationManager
|
||||||
$this->WriteConfig($config);
|
$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 {
|
public function isCollaboraEnabled() : bool {
|
||||||
$config = $this->GetConfig();
|
$config = $this->GetConfig();
|
||||||
if (isset($config['isCollaboraEnabled']) && $config['isCollaboraEnabled'] === 0) {
|
if (isset($config['isCollaboraEnabled']) && $config['isCollaboraEnabled'] === 0) {
|
||||||
|
|
|
||||||
|
|
@ -573,7 +573,7 @@ readonly class DockerActionManager {
|
||||||
'BACKUP_RESTORE_PASSWORD' => $this->configurationManager->GetBorgRestorePassword(),
|
'BACKUP_RESTORE_PASSWORD' => $this->configurationManager->GetBorgRestorePassword(),
|
||||||
'CLAMAV_ENABLED' => $this->configurationManager->isClamavEnabled ? 'yes' : '',
|
'CLAMAV_ENABLED' => $this->configurationManager->isClamavEnabled ? 'yes' : '',
|
||||||
'TALK_RECORDING_ENABLED' => $this->configurationManager->isTalkRecordingEnabled() ? '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' : '',
|
'COLLABORA_ENABLED' => $this->configurationManager->isCollaboraEnabled() ? 'yes' : '',
|
||||||
'TALK_ENABLED' => $this->configurationManager->isTalkEnabled() ? 'yes' : '',
|
'TALK_ENABLED' => $this->configurationManager->isTalkEnabled() ? 'yes' : '',
|
||||||
'UPDATE_NEXTCLOUD_APPS' => ($this->configurationManager->isDailyBackupRunning() && $this->configurationManager->areAutomaticUpdatesEnabled()) ? 'yes' : '',
|
'UPDATE_NEXTCLOUD_APPS' => ($this->configurationManager->isDailyBackupRunning() && $this->configurationManager->areAutomaticUpdatesEnabled()) ? 'yes' : '',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue