1
0

ReasonsController.php 819 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\Settings\Controller;
  8. use OCP\AppFramework\Controller;
  9. use OCP\AppFramework\Http\Attribute\NoAdminRequired;
  10. use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
  11. use OCP\AppFramework\Http\Attribute\OpenAPI;
  12. use OCP\AppFramework\Http\DataDisplayResponse;
  13. #[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
  14. class ReasonsController extends Controller {
  15. /**
  16. * @NoSubAdminRequired
  17. */
  18. #[NoAdminRequired]
  19. #[NoCSRFRequired]
  20. public function getPdf() {
  21. $data = file_get_contents(__DIR__ . '/../../data/Reasons to use Nextcloud.pdf');
  22. $resp = new DataDisplayResponse($data);
  23. $resp->addHeader('Content-Type', 'application/pdf');
  24. return $resp;
  25. }
  26. }