diff --git a/lib/Controller/PublicViewController.php b/lib/Controller/PublicViewController.php index 168625c483..ca16161ac7 100644 --- a/lib/Controller/PublicViewController.php +++ b/lib/Controller/PublicViewController.php @@ -6,6 +6,7 @@ * * @author Georg Ehrke * @copyright 2019 Georg Ehrke + * @copyright Copyright (c) 2022 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE @@ -128,6 +129,7 @@ private function publicIndex(string $token, $defaultSlotDuration = $this->config->getAppValue($this->appName, 'slotDuration', '00:30:00'); $defaultDefaultReminder = $this->config->getAppValue($this->appName, 'defaultReminder', 'none'); $defaultShowTasks = $this->config->getAppValue($this->appName, 'showTasks', 'yes'); + $defaultCanSharePublicLink = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes'); $appVersion = $this->config->getAppValue($this->appName, 'installed_version', null); @@ -146,6 +148,7 @@ private function publicIndex(string $token, $this->initialStateService->provideInitialState($this->appName, 'show_tasks', $defaultShowTasks === 'yes'); $this->initialStateService->provideInitialState($this->appName, 'tasks_enabled', false); $this->initialStateService->provideInitialState($this->appName, 'hide_event_export', false); + $this->initialStateService->provideInitialState($this->appName, 'can_share_public_link', $defaultCanSharePublicLink); return new TemplateResponse($this->appName, 'main', [ 'share_url' => $this->getShareURL(), diff --git a/lib/Controller/ViewController.php b/lib/Controller/ViewController.php index 2cbf8335c4..c9d0abd63b 100644 --- a/lib/Controller/ViewController.php +++ b/lib/Controller/ViewController.php @@ -6,6 +6,7 @@ * * @author Georg Ehrke * @copyright 2019 Georg Ehrke + * @copyright Copyright (c) 2022 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE @@ -100,6 +101,7 @@ public function index():TemplateResponse { if (!in_array($forceEventAlarmType, ['DISPLAY', 'EMAIL'], true)) { $forceEventAlarmType = false; } + $canSharePublicLink = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes'; $talkEnabled = $this->appManager->isEnabledForUser('spreed'); $talkApiVersion = version_compare($this->appManager->getAppVersion('spreed'), '12.0.0', '>=') ? 'v4' : 'v1'; @@ -123,6 +125,7 @@ public function index():TemplateResponse { $this->initialStateService->provideInitialState('force_event_alarm_type', $forceEventAlarmType); $this->initialStateService->provideInitialState('appointmentConfigs', $this->appointmentConfigService->getAllAppointmentConfigurations($this->userId)); $this->initialStateService->provideInitialState('disable_appointments', $disableAppointments); + $this->initialStateService->provideInitialState('can_share_public_link', $canSharePublicLink); return new TemplateResponse($this->appName, 'main'); } diff --git a/src/components/AppNavigation/CalendarList/CalendarListItem.vue b/src/components/AppNavigation/CalendarList/CalendarListItem.vue index 25d30fedf9..7b035c4f78 100644 --- a/src/components/AppNavigation/CalendarList/CalendarListItem.vue +++ b/src/components/AppNavigation/CalendarList/CalendarListItem.vue @@ -1,5 +1,6 @@