* 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)
| 313 | * @throws Exception |
| 314 | */ |
| 315 | #[NoAdminRequired] |
| 316 | #[UseSession] |
| 317 | #[PublicPage] |
| 318 | public function readPublic($token, $filteroptions, $dataoptions, $chartoptions, $tableoptions) { |
| 319 | $share = $this->ShareService->getReportByToken($token); |
| 320 | if (empty($share)) { |
| 321 | // Dataset not shared or wrong token |
| 322 | return new NotFoundResponse(); |
| 323 | } else { |
| 324 | if ($share['password'] !== null) { |
| 325 | if (!$this->DataSession->isShareAuthenticated($token, $share['password'])) { |
| 326 | return new NotFoundResponse(); |
| 327 | } |
| 328 | } |
| 329 | $share = $this->evaluateCanFilter($share, $filteroptions, $dataoptions, $chartoptions, $tableoptions); |
| 330 | $result = $this->getData($share); |
| 331 | return new DataResponse($result, HTTP::STATUS_OK); |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | /** |
| 336 | * 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