PersonalSettingsController.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\Settings\Controller;
  7. use OCP\AppFramework\Controller;
  8. use OCP\AppFramework\Http\Attribute\NoAdminRequired;
  9. use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
  10. use OCP\AppFramework\Http\Attribute\OpenAPI;
  11. use OCP\AppFramework\Http\TemplateResponse;
  12. use OCP\AppFramework\Services\IInitialState;
  13. use OCP\Group\ISubAdmin;
  14. use OCP\IGroupManager;
  15. use OCP\INavigationManager;
  16. use OCP\IRequest;
  17. use OCP\IUserSession;
  18. use OCP\Settings\IDeclarativeManager;
  19. use OCP\Settings\IManager as ISettingsManager;
  20. #[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
  21. class PersonalSettingsController extends Controller {
  22. use CommonSettingsTrait;
  23. public function __construct(
  24. $appName,
  25. IRequest $request,
  26. INavigationManager $navigationManager,
  27. ISettingsManager $settingsManager,
  28. IUserSession $userSession,
  29. IGroupManager $groupManager,
  30. ISubAdmin $subAdmin,
  31. IDeclarativeManager $declarativeSettingsManager,
  32. IInitialState $initialState,
  33. ) {
  34. parent::__construct($appName, $request);
  35. $this->navigationManager = $navigationManager;
  36. $this->settingsManager = $settingsManager;
  37. $this->userSession = $userSession;
  38. $this->subAdmin = $subAdmin;
  39. $this->groupManager = $groupManager;
  40. $this->declarativeSettingsManager = $declarativeSettingsManager;
  41. $this->initialState = $initialState;
  42. }
  43. /**
  44. * @NoSubAdminRequired
  45. */
  46. #[NoAdminRequired]
  47. #[NoCSRFRequired]
  48. public function index(string $section): TemplateResponse {
  49. return $this->getIndexResponse(
  50. 'personal',
  51. $section,
  52. );
  53. }
  54. }