2017-06-01 09:37:23 -04:00
|
|
|
<?php
|
2025-06-30 09:04:05 -04:00
|
|
|
|
2017-06-01 09:37:23 -04:00
|
|
|
/**
|
2024-06-06 03:55:47 -04:00
|
|
|
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2017-06-01 09:37:23 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCA\Files_External\Settings;
|
|
|
|
|
|
|
|
|
|
use OCA\Files_External\Lib\Auth\Password\GlobalAuth;
|
|
|
|
|
use OCA\Files_External\Service\BackendService;
|
|
|
|
|
use OCP\AppFramework\Http\TemplateResponse;
|
2024-03-17 19:48:10 -04:00
|
|
|
use OCP\AppFramework\Services\IInitialState;
|
2026-01-12 06:28:18 -05:00
|
|
|
use OCP\Encryption\IManager;
|
2024-03-17 19:48:10 -04:00
|
|
|
use OCP\IURLGenerator;
|
2017-06-01 09:37:23 -04:00
|
|
|
use OCP\Settings\ISettings;
|
|
|
|
|
|
|
|
|
|
class Personal implements ISettings {
|
2024-03-17 16:24:42 -04:00
|
|
|
use CommonSettingsTrait;
|
2017-06-01 09:37:23 -04:00
|
|
|
|
|
|
|
|
public function __construct(
|
2024-03-17 19:48:10 -04:00
|
|
|
?string $userId,
|
2024-10-18 06:04:22 -04:00
|
|
|
private BackendService $backendService,
|
|
|
|
|
private GlobalAuth $globalAuth,
|
2024-03-17 19:48:10 -04:00
|
|
|
private IInitialState $initialState,
|
|
|
|
|
private IURLGenerator $urlGenerator,
|
2026-01-12 06:28:18 -05:00
|
|
|
private IManager $encryptionManager,
|
2017-06-01 09:37:23 -04:00
|
|
|
) {
|
2024-03-17 19:48:10 -04:00
|
|
|
$this->userId = $userId;
|
2026-01-12 06:28:18 -05:00
|
|
|
$this->visibility = BackendService::VISIBILITY_PERSONAL;
|
2017-06-01 09:37:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return TemplateResponse
|
|
|
|
|
*/
|
|
|
|
|
public function getForm() {
|
2026-01-12 06:28:18 -05:00
|
|
|
$this->setInitialState();
|
2024-03-17 16:24:42 -04:00
|
|
|
$this->loadScriptsAndStyles();
|
2024-03-17 19:48:10 -04:00
|
|
|
return new TemplateResponse('files_external', 'settings', renderAs: '');
|
2017-06-01 09:37:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getSection() {
|
2026-01-12 06:28:18 -05:00
|
|
|
if (!$this->backendService->isUserMountingAllowed()) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-01 09:37:23 -04:00
|
|
|
return 'externalstorages';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @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 40;
|
|
|
|
|
}
|
|
|
|
|
}
|