mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-04 04:56:52 +00:00
Make isTalkEnabled an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
18e5141c15
commit
d895e0d8e1
5 changed files with 10 additions and 24 deletions
|
|
@ -113,7 +113,7 @@ $app->get('/containers', function (Request $request, Response $response, array $
|
|||
'is_clamav_enabled' => $configurationManager->isClamavEnabled,
|
||||
'is_onlyoffice_enabled' => $configurationManager->isOnlyofficeEnabled,
|
||||
'is_collabora_enabled' => $configurationManager->isCollaboraEnabled,
|
||||
'is_talk_enabled' => $configurationManager->isTalkEnabled(),
|
||||
'is_talk_enabled' => $configurationManager->isTalkEnabled,
|
||||
'borg_restore_password' => $configurationManager->GetBorgRestorePassword(),
|
||||
'daily_backup_time' => $configurationManager->GetDailyBackupTime(),
|
||||
'is_daily_backup_running' => $configurationManager->isDailyBackupRunning(),
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ readonly class ContainerDefinitionFetcher {
|
|||
$entry['image'] = 'ghcr.io/nextcloud-releases/aio-collabora-online';
|
||||
}
|
||||
} elseif ($entry['container_name'] === 'nextcloud-aio-talk') {
|
||||
if (!$this->configurationManager->isTalkEnabled()) {
|
||||
if (!$this->configurationManager->isTalkEnabled) {
|
||||
continue;
|
||||
}
|
||||
} elseif ($entry['container_name'] === 'nextcloud-aio-talk-recording') {
|
||||
|
|
@ -180,7 +180,7 @@ readonly class ContainerDefinitionFetcher {
|
|||
continue;
|
||||
}
|
||||
} elseif ($value === 'nextcloud-aio-talk') {
|
||||
if (!$this->configurationManager->isTalkEnabled()) {
|
||||
if (!$this->configurationManager->isTalkEnabled) {
|
||||
continue;
|
||||
}
|
||||
} elseif ($value === 'nextcloud-aio-talk-recording') {
|
||||
|
|
|
|||
|
|
@ -82,11 +82,7 @@ readonly class ConfigurationController {
|
|||
$this->configurationManager->isClamavEnabled = isset($request->getParsedBody()['clamav']);
|
||||
$this->configurationManager->isOnlyofficeEnabled = isset($request->getParsedBody()['onlyoffice']);
|
||||
$this->configurationManager->isCollaboraEnabled = isset($request->getParsedBody()['collabora']);
|
||||
if (isset($request->getParsedBody()['talk'])) {
|
||||
$this->configurationManager->SetTalkEnabledState(1);
|
||||
} else {
|
||||
$this->configurationManager->SetTalkEnabledState(0);
|
||||
}
|
||||
$this->configurationManager->isTalkEnabled = isset($request->getParsedBody()['talk']);
|
||||
if (isset($request->getParsedBody()['talk-recording'])) {
|
||||
$this->configurationManager->SetTalkRecordingEnabledState(1);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -83,6 +83,11 @@ class ConfigurationManager
|
|||
set { $this->set('isCollaboraEnabled', $value); }
|
||||
}
|
||||
|
||||
public bool $isTalkEnabled {
|
||||
get => $this->get('isTalkEnabled', true);
|
||||
set { $this->set('isTalkEnabled', $value); }
|
||||
}
|
||||
|
||||
public function GetConfig() : array
|
||||
{
|
||||
if ($this->config === [] && file_exists(DataConst::GetConfigFile()))
|
||||
|
|
@ -253,21 +258,6 @@ class ConfigurationManager
|
|||
$this->WriteConfig($config);
|
||||
}
|
||||
|
||||
public function isTalkEnabled() : bool {
|
||||
$config = $this->GetConfig();
|
||||
if (isset($config['isTalkEnabled']) && $config['isTalkEnabled'] === 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public function SetTalkEnabledState(int $value) : void {
|
||||
$config = $this->GetConfig();
|
||||
$config['isTalkEnabled'] = $value;
|
||||
$this->WriteConfig($config);
|
||||
}
|
||||
|
||||
public function isTalkRecordingEnabled() : bool {
|
||||
if (!$this->isTalkEnabled()) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -575,7 +575,7 @@ readonly class DockerActionManager {
|
|||
'TALK_RECORDING_ENABLED' => $this->configurationManager->isTalkRecordingEnabled() ? 'yes' : '',
|
||||
'ONLYOFFICE_ENABLED' => $this->configurationManager->isOnlyofficeEnabled ? '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' : '',
|
||||
'TIMEZONE' => $this->configurationManager->GetTimezone() === '' ? 'Etc/UTC' : $this->configurationManager->GetTimezone(),
|
||||
'COLLABORA_DICTIONARIES' => $this->configurationManager->GetCollaboraDictionaries() === '' ? 'de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru' : $this->configurationManager->GetCollaboraDictionaries(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue