MCPcopy Create free account
hub / github.com/Rello/analytics / indexPublic

Method indexPublic

lib/Controller/PageController.php:204–225  ·  view source on GitHub ↗

* @param $token * @param string $password * @return TemplateResponse|RedirectResponse */

($token)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

redirectToLoginMethod · 0.95
hasShareAccessMethod · 0.95
passwordPromptMethod · 0.95
getReportByTokenMethod · 0.45

Tested by

no test coverage detected