appName = $appName; $this->eventDispatcher = $eventDispatcher; $this->initialState = $initialState; $this->appManager = $appManager; $this->config = $config; $this->connection = $connection; } /** * @PublicPage * * @NoCSRFRequired */ public function showShare(string $token): TemplateResponse { \OC_User::setIncognitoMode(true); // Validate token exists $timelineQuery = new TimelineQuery($this->connection); $album = $timelineQuery->getAlbumByLink($token); if (!$album) { return new TemplateResponse('core', '404', [], 'guest'); } // Scripts Util::addScript($this->appName, 'memories-main'); $this->eventDispatcher->dispatchTyped(new LoadSidebar()); PageController::provideCommonInitialState($this->initialState); $response = new PublicTemplateResponse($this->appName, 'main'); $response->setHeaderTitle($album['name']); $response->setFooterVisible(false); // wth is that anyway? $response->setContentSecurityPolicy(PageController::getCSP()); return $response; } }