HEX
Server: LiteSpeed
System: Linux d8 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: wbwebdes (3015)
PHP: 8.1.31
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/wbwebdes/domains/files.wb-cloud.nl/public_html/apps/dav/lib/Settings/CalDAVSettings.php
<?php

/**
 * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */
namespace OCA\DAV\Settings;

use OCA\DAV\AppInfo\Application;
use OCP\App\IAppManager;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\IConfig;
use OCP\IURLGenerator;
use OCP\Settings\IDelegatedSettings;

class CalDAVSettings implements IDelegatedSettings {

	private const defaults = [
		'sendInvitations' => 'yes',
		'generateBirthdayCalendar' => 'yes',
		'sendEventReminders' => 'yes',
		'sendEventRemindersToSharedUsers' => 'yes',
		'sendEventRemindersPush' => 'yes',
	];

	/**
	 * CalDAVSettings constructor.
	 *
	 * @param IConfig $config
	 * @param IInitialState $initialState
	 */
	public function __construct(
		private IConfig $config,
		private IInitialState $initialState,
		private IURLGenerator $urlGenerator,
		private IAppManager $appManager,
	) {
	}

	public function getForm(): TemplateResponse {
		$this->initialState->provideInitialState('userSyncCalendarsDocUrl', $this->urlGenerator->linkToDocs('user-sync-calendars'));
		foreach (self::defaults as $key => $default) {
			$value = $this->config->getAppValue(Application::APP_ID, $key, $default);
			$this->initialState->provideInitialState($key, $value === 'yes');
		}
		return new TemplateResponse(Application::APP_ID, 'settings-admin-caldav');
	}

	public function getSection(): ?string {
		if (!$this->appManager->isBackendRequired(IAppManager::BACKEND_CALDAV)) {
			return null;
		}

		return 'groupware';
	}

	/**
	 * @return int
	 */
	public function getPriority() {
		return 10;
	}

	public function getName(): ?string {
		return null; // Only setting in this section
	}

	public function getAuthorizedAppConfig(): array {
		return [
			'dav' => ['/(' . implode('|', array_keys(self::defaults)) . ')/']
		];
	}
}