add clamav as option

Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
szaimen 2022-03-15 23:46:58 +01:00
parent 31f86c1570
commit 38726f039a
13 changed files with 155 additions and 7 deletions

View file

@ -35,6 +35,17 @@ class ConfigurationController
$this->configurationManager->SetBorgBackupHostLocation($request->getParsedBody()['borg_backup_host_location']);
}
if (isset($request->getParsedBody()['clamav'])) {
$value = $request->getParsedBody()['clamav'];
if ($value === 'on') {
$this->configurationManager->SetClamavEnabledState(1);
} elseif ($value === 'off') {
$this->configurationManager->SetClamavEnabledState(0);
} else {
error_log('It seems like clamav was changed but not to on or off.');
}
}
return $response->withStatus(201)->withHeader('Location', '/');
} catch (InvalidSettingConfigurationException $ex) {
$response->getBody()->write($ex->getMessage());