* get the data when requested from public page * * @param $token * @param $filteroptions * @param $dataoptions * @param $chartoptions * @param $tableoptions * @return DataResponse|NotFoundResponse * @throws Exception */
($token, $filteroptions, $dataoptions, $chartoptions, $tableoptions, ?string $chart = null, ?string $visualization = null)
| 391 | * @throws Exception |
| 392 | */ |
| 393 | #[NoAdminRequired] |
| 394 | #[UseSession] |
| 395 | #[PublicPage] |
| 396 | public function readPublic($token, $filteroptions, $dataoptions, $chartoptions, $tableoptions, ?string $chart = null, ?string $visualization = null) { |
| 397 | $share = $this->ShareService->getReportByToken($token); |
| 398 | if (empty($share)) { |
| 399 | // Dataset not shared or wrong token |
| 400 | return new NotFoundResponse(); |
| 401 | } else { |
| 402 | if ($share['password'] !== null) { |
| 403 | if (!$this->DataSession->isShareAuthenticated($token, $share['password'])) { |
| 404 | return new NotFoundResponse(); |
| 405 | } |
| 406 | } |
| 407 | $share = $this->evaluateCanFilter($share, $filteroptions, $dataoptions, $chartoptions, $tableoptions, $chart, $visualization); |
| 408 | $result = $this->getData($share); |
| 409 | return new DataResponse($result, HTTP::STATUS_OK); |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | /** |
| 414 | * evaluate if the user did filter in the report and if he is allowed to filter (shared reports) |
nothing calls this directly
no test coverage detected