* @param $token * @param string $password * @return TemplateResponse|RedirectResponse */
($token)
| 188 | * @return TemplateResponse|RedirectResponse |
| 189 | */ |
| 190 | #[PublicPage] |
| 191 | #[UseSession] |
| 192 | #[NoCSRFRequired] |
| 193 | public function indexPublic($token) |
| 194 | { |
| 195 | $share = $this->ShareService->getReportByToken($token); |
| 196 | |
| 197 | if (empty($share)) { |
| 198 | // Dataset not shared or wrong token |
| 199 | return $this->redirectToLogin($token); |
| 200 | } else { |
| 201 | if (!$this->hasShareAccess($token, $share)) { |
| 202 | return $this->passwordPrompt($token, false); |
| 203 | } |
| 204 | $params = array(); |
| 205 | $params['token'] = $token; |
| 206 | $response = new PublicTemplateResponse($this->appName, 'public', $params); |
| 207 | $response->setHeaderTitle('Nextcloud Analytics'); |
| 208 | $response->setFooterVisible(false); |
| 209 | return $response; |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | /** |
| 214 | * @param $token |
nothing calls this directly
no test coverage detected