ReasonsController.php 716 B

12345678910111213141516171819202122232425262728293031
  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\OpenAPI;
  10. use OCP\AppFramework\Http\DataDisplayResponse;
  11. #[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
  12. class ReasonsController extends Controller {
  13. /**
  14. * @NoCSRFRequired
  15. * @NoAdminRequired
  16. * @NoSubAdminRequired
  17. */
  18. public function getPdf() {
  19. $data = file_get_contents(__DIR__ . '/../../data/Reasons to use Nextcloud.pdf');
  20. $resp = new DataDisplayResponse($data);
  21. $resp->addHeader('Content-Type', 'application/pdf');
  22. return $resp;
  23. }
  24. }