* 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)
| 337 | * @throws Exception |
| 338 | */ |
| 339 | #[NoAdminRequired] |
| 340 | #[UseSession] |
| 341 | #[PublicPage] |
| 342 | public function readPublic($token, $filteroptions, $dataoptions, $chartoptions, $tableoptions) { |
| 343 | $share = $this->ShareService->getReportByToken($token); |
| 344 | if (empty($share)) { |
| 345 | // Dataset not shared or wrong token |
| 346 | return new NotFoundResponse(); |
| 347 | } else { |
| 348 | if ($share['password'] !== null) { |
| 349 | if (!$this->DataSession->isShareAuthenticated($token, $share['password'])) { |
| 350 | return new NotFoundResponse(); |
| 351 | } |
| 352 | } |
| 353 | $share = $this->evaluateCanFilter($share, $filteroptions, $dataoptions, $chartoptions, $tableoptions); |
| 354 | $result = $this->getData($share); |
| 355 | return new DataResponse($result, HTTP::STATUS_OK); |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | /** |
| 360 | * 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