summaryrefslogtreecommitdiffstats
path: root/lib/Controller/LocalController.php
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-12-19 09:48:07 +0100
committerJulius Härtl <jus@bitgrid.net>2018-12-20 11:07:49 +0100
commit4253672fc10cf2c35bd5dba6928bc03a085b294a (patch)
treeefd4ff8cf1117056342ea6d4310fe95cf9e48d19 /lib/Controller/LocalController.php
parente6b52524d40bf0f1611558c46c13b63125eb8530 (diff)
Rework frontend controllers for page rendering
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/Controller/LocalController.php')
-rw-r--r--lib/Controller/LocalController.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php
index 6ab4994f..fd64a64b 100644
--- a/lib/Controller/LocalController.php
+++ b/lib/Controller/LocalController.php
@@ -238,6 +238,7 @@ class LocalController extends Controller {
/**
* @NoAdminRequired
* @NoSubAdminRequired
+ * @PublicPage
*
* @param string $username
* @param int $since
@@ -424,6 +425,7 @@ class LocalController extends Controller {
/**
* @NoAdminRequired
* @NoSubAdminRequired
+ * @PublicPage
*
* @param string $username
*
@@ -445,6 +447,7 @@ class LocalController extends Controller {
/**
* @NoAdminRequired
* @NoSubAdminRequired
+ * @PublicPage
*
* @param string $username
*
@@ -467,6 +470,7 @@ class LocalController extends Controller {
/**
* @NoAdminRequired
* @NoSubAdminRequired
+ * @PublicPage
*
* @param string $username
*
@@ -626,6 +630,15 @@ class LocalController extends Controller {
* @throws AccountDoesNotExistException
*/
private function initViewer(bool $exception = false) {
+ // only initialize viewer data for logged in users
+ if ($this->userId === null) {
+ // TODO: properly set viewer
+ $this->followService->setViewerId('guest');
+ $this->personService->setViewerId('guest');
+ $this->noteService->setViewerId('guest');
+ return;
+ }
+
try {
$this->viewer = $this->accountService->getActorFromUserId($this->userId, true);