2018-03-29 11:12:03 -04:00
|
|
|
<?php
|
2025-06-30 09:04:05 -04:00
|
|
|
|
2018-03-29 11:12:03 -04:00
|
|
|
/**
|
2024-06-03 04:23:34 -04:00
|
|
|
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2018-03-29 11:12:03 -04:00
|
|
|
*/
|
2020-01-31 10:55:17 -05:00
|
|
|
namespace OCA\Settings\Settings\Admin;
|
2018-03-29 11:12:03 -04:00
|
|
|
|
|
|
|
|
use OCP\AppFramework\Http\TemplateResponse;
|
2025-08-26 09:24:46 -04:00
|
|
|
use OCP\AppFramework\Services\IInitialState;
|
2018-03-29 11:12:03 -04:00
|
|
|
use OCP\IConfig;
|
2021-07-22 05:41:29 -04:00
|
|
|
use OCP\IL10N;
|
2025-08-26 09:24:46 -04:00
|
|
|
use OCP\IURLGenerator;
|
2024-09-17 16:38:44 -04:00
|
|
|
use OCP\ServerVersion;
|
2021-07-22 05:41:29 -04:00
|
|
|
use OCP\Settings\IDelegatedSettings;
|
2025-08-26 09:24:46 -04:00
|
|
|
use OCP\Util;
|
2018-03-29 11:12:03 -04:00
|
|
|
|
2021-07-22 05:41:29 -04:00
|
|
|
class Overview implements IDelegatedSettings {
|
2024-09-17 16:38:44 -04:00
|
|
|
public function __construct(
|
|
|
|
|
private ServerVersion $serverVersion,
|
|
|
|
|
private IConfig $config,
|
|
|
|
|
private IL10N $l,
|
2025-08-26 09:24:46 -04:00
|
|
|
private IInitialState $initialState,
|
|
|
|
|
private IURLGenerator $urlGenerator,
|
2024-09-17 16:38:44 -04:00
|
|
|
) {
|
2018-03-29 11:12:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return TemplateResponse
|
|
|
|
|
*/
|
|
|
|
|
public function getForm() {
|
2025-08-26 09:24:46 -04:00
|
|
|
Util::addScript('settings', 'vue-settings-admin-overview');
|
|
|
|
|
$this->initialState->provideInitialState('setup-checks-section', [
|
|
|
|
|
'sectionDocsUrl' => $this->urlGenerator->linkToDocs('admin-warnings'),
|
|
|
|
|
'installationGuidesDocsUrl' => $this->urlGenerator->linkToDocs('admin-install'),
|
|
|
|
|
'loggingSectionUrl' => $this->urlGenerator->linkToRoute('settings.AdminSettings.index', ['section' => 'logging']),
|
|
|
|
|
]);
|
|
|
|
|
|
2018-03-29 11:12:03 -04:00
|
|
|
$parameters = [
|
2020-10-05 09:12:57 -04:00
|
|
|
'checkForWorkingWellKnownSetup' => $this->config->getSystemValue('check_for_working_wellknown_setup', true),
|
2024-09-17 16:38:44 -04:00
|
|
|
'version' => $this->serverVersion->getHumanVersion(),
|
2018-03-29 11:12:03 -04:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return new TemplateResponse('settings', 'settings/admin/overview', $parameters, '');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string the section ID, e.g. 'sharing'
|
|
|
|
|
*/
|
|
|
|
|
public function getSection() {
|
|
|
|
|
return 'overview';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return int whether the form should be rather on the top or bottom of
|
|
|
|
|
* the admin section. The forms are arranged in ascending order of the
|
|
|
|
|
* priority values. It is required to return a value between 0 and 100.
|
|
|
|
|
*
|
|
|
|
|
* E.g.: 70
|
|
|
|
|
*/
|
|
|
|
|
public function getPriority() {
|
|
|
|
|
return 10;
|
|
|
|
|
}
|
2021-07-22 05:41:29 -04:00
|
|
|
|
|
|
|
|
public function getName(): ?string {
|
2024-10-23 17:31:59 -04:00
|
|
|
return $this->l->t('Security & setup checks');
|
2021-07-22 05:41:29 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getAuthorizedAppConfig(): array {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
2018-03-29 11:12:03 -04:00
|
|
|
}
|