repod/lib/Controller/PageController.php
Michel Roux 559c6f9881
Some checks failed
repod / nextcloud-25 (push) Failing after 55s
repod / nextcloud-27 (push) Failing after 41s
repod / nodejs (push) Successful in 1m40s
Top ok
2023-07-03 00:12:40 +02:00

35 lines
771 B
PHP

<?php
declare(strict_types=1);
namespace OCA\RePod\Controller;
use OCA\RePod\AppInfo\Application;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IRequest;
use OCP\Util;
class PageController extends Controller
{
public function __construct(IRequest $request) {
parent::__construct(Application::APP_ID, $request);
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function index(): TemplateResponse {
Util::addScript(Application::APP_ID, 'repod-main');
$csp = new ContentSecurityPolicy();
$csp->addAllowedImageDomain('*');
$response = new TemplateResponse(Application::APP_ID, 'main');
$response->setContentSecurityPolicy($csp);
return $response;
}
}