allow to disable/enable talk-recording

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-06-05 15:05:14 +02:00
parent 07faad0ab2
commit 70f27ae304
12 changed files with 113 additions and 4 deletions

View file

@ -81,6 +81,10 @@ class ContainerDefinitionFetcher
if (!$this->configurationManager->isTalkEnabled()) {
continue;
}
} elseif ($entry['container_name'] === 'nextcloud-aio-talk-recording') {
if (!$this->configurationManager->isTalkRecordingEnabled()) {
continue;
}
} elseif ($entry['container_name'] === 'nextcloud-aio-imaginary') {
if (!$this->configurationManager->isImaginaryEnabled()) {
continue;
@ -179,6 +183,10 @@ class ContainerDefinitionFetcher
if (!$this->configurationManager->isTalkEnabled()) {
continue;
}
} elseif ($value === 'nextcloud-aio-talk-recording') {
if (!$this->configurationManager->isTalkRecordingEnabled()) {
continue;
}
} elseif ($value === 'nextcloud-aio-imaginary') {
if (!$this->configurationManager->isImaginaryEnabled()) {
continue;

View file

@ -95,6 +95,11 @@ class ConfigurationController
} else {
$this->configurationManager->SetTalkEnabledState(0);
}
if (isset($request->getParsedBody()['talk-recording'])) {
$this->configurationManager->SetTalkRecordingEnabledState(1);
} else {
$this->configurationManager->SetTalkRecordingEnabledState(0);
}
if (isset($request->getParsedBody()['imaginary'])) {
$this->configurationManager->SetImaginaryEnabledState(1);
} else {

View file

@ -230,6 +230,27 @@ class ConfigurationManager
$this->WriteConfig($config);
}
public function isTalkRecordingEnabled() : bool {
if (!$this->isTalkEnabled()) {
return false;
}
$config = $this->GetConfig();
if (isset($config['isTalkRecordingEnabled']) && $config['isTalkRecordingEnabled'] === 1) {
return true;
} else {
return false;
}
}
public function SetTalkRecordingEnabledState(int $value) : void {
if (!$this->isTalkEnabled()) {
$value = 0;
}
$config = $this->GetConfig();
$config['isTalkRecordingEnabled'] = $value;
$this->WriteConfig($config);
}
/**
* @throws InvalidSettingConfigurationException
*/

View file

@ -278,6 +278,12 @@ class DockerActionManager
} else {
$replacements[1] = '';
}
} elseif ($out[1] === 'TALK_RECORDING_ENABLED') {
if ($this->configurationManager->isTalkRecordingEnabled()) {
$replacements[1] = 'yes';
} else {
$replacements[1] = '';
}
} elseif ($out[1] === 'ONLYOFFICE_ENABLED') {
if ($this->configurationManager->isOnlyofficeEnabled()) {
$replacements[1] = 'yes';