UnsupportedBrowserController.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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\OpenAPI;
  11. use OCP\AppFramework\Http\Response;
  12. use OCP\AppFramework\Http\TemplateResponse;
  13. use OCP\IRequest;
  14. use OCP\Util;
  15. #[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
  16. class UnsupportedBrowserController extends Controller {
  17. public function __construct(IRequest $request) {
  18. parent::__construct('core', $request);
  19. }
  20. /**
  21. * @PublicPage
  22. * @NoCSRFRequired
  23. *
  24. * @return Response
  25. */
  26. #[FrontpageRoute(verb: 'GET', url: 'unsupported')]
  27. public function index(): Response {
  28. Util::addScript('core', 'unsupported-browser');
  29. Util::addStyle('core', 'icons');
  30. // not using RENDER_AS_ERROR as we need the JSConfigHelper for url generation
  31. return new TemplateResponse('core', 'unsupportedbrowser', [], TemplateResponse::RENDER_AS_GUEST);
  32. }
  33. }