UnsupportedBrowserController.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC\Core\Controller;
  8. use OCP\AppFramework\Controller;
  9. use OCP\AppFramework\Http\Attribute\FrontpageRoute;
  10. use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
  11. use OCP\AppFramework\Http\Attribute\OpenAPI;
  12. use OCP\AppFramework\Http\Attribute\PublicPage;
  13. use OCP\AppFramework\Http\Response;
  14. use OCP\AppFramework\Http\TemplateResponse;
  15. use OCP\IRequest;
  16. use OCP\Util;
  17. #[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
  18. class UnsupportedBrowserController extends Controller {
  19. public function __construct(IRequest $request) {
  20. parent::__construct('core', $request);
  21. }
  22. /**
  23. * @return Response
  24. */
  25. #[PublicPage]
  26. #[NoCSRFRequired]
  27. #[FrontpageRoute(verb: 'GET', url: 'unsupported')]
  28. public function index(): Response {
  29. Util::addScript('core', 'unsupported-browser');
  30. Util::addStyle('core', 'icons');
  31. // not using RENDER_AS_ERROR as we need the JSConfigHelper for url generation
  32. return new TemplateResponse('core', 'unsupportedbrowser', [], TemplateResponse::RENDER_AS_GUEST);
  33. }
  34. }