* @param $token * @param string $password * @return TemplateResponse|RedirectResponse */
($token)
| 202 | * @return TemplateResponse|RedirectResponse |
| 203 | */ |
| 204 | #[PublicPage] |
| 205 | #[UseSession] |
| 206 | #[NoCSRFRequired] |
| 207 | public function indexPublic($token) |
| 208 | { |
| 209 | $share = $this->ShareService->getReportByToken($token); |
| 210 | |
| 211 | if (empty($share)) { |
| 212 | // Dataset not shared or wrong token |
| 213 | return $this->redirectToLogin($token); |
| 214 | } else { |
| 215 | if (!$this->hasShareAccess($token, $share)) { |
| 216 | return $this->passwordPrompt($token, false); |
| 217 | } |
| 218 | $params = array(); |
| 219 | $params['token'] = $token; |
| 220 | $response = new PublicTemplateResponse($this->appName, 'public', $params); |
| 221 | $response->setHeaderTitle('Nextcloud Analytics'); |
| 222 | $response->setFooterVisible(false); |
| 223 | return $response; |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | /** |
| 228 | * @param $token |
nothing calls this directly
no test coverage detected