diff --git a/php/public/index.php b/php/public/index.php index 182ef889..25801f58 100644 --- a/php/public/index.php +++ b/php/public/index.php @@ -25,6 +25,7 @@ use Psr\Http\Message\ServerRequestInterface as Request; require __DIR__ . '/../vendor/autoload.php'; $container = \AIO\DependencyInjection::GetContainer(); +$container->get(\AIO\Data\ConfigurationManager::class)->performMigrations(); $dataConst = $container->get(\AIO\Data\DataConst::class); // Create app diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index 6a6556ec..b930a9d3 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -100,13 +100,14 @@ class ConfigurationManager } public bool $isEuroofficeEnabled { - get => $this->get('isEuroofficeEnabled', false); + // Type-cast because old configs could have 1/0 for this key. + get => (bool) $this->get('isEuroofficeEnabled', true); set { $this->set('isEuroofficeEnabled', $value); } } public bool $isCollaboraEnabled { // Type-cast because old configs could have 1/0 for this key. - get => (bool) $this->get('isCollaboraEnabled', true); + get => (bool) $this->get('isCollaboraEnabled', false); set { $this->set('isCollaboraEnabled', $value); } } @@ -927,7 +928,16 @@ class ConfigurationManager if (is_string($apps)) { return trim($apps); } - return 'deck twofactor_totp tasks calendar contacts notes'; + return 'deck twofactor_totp tasks calendar contacts notes eurooffice'; + } + + public function performMigrations(): void { + if (!$this->get('eurooffice_default_migration_v1', false)) { + $this->isCollaboraEnabled = false; + $this->isOnlyofficeEnabled = false; + $this->isEuroofficeEnabled = true; + $this->set('eurooffice_default_migration_v1', true); + } } /**