Make sure to render as public if the user is not logged in

Else we will render the apps, contacts menu etc. Which is undesireable.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2019-06-27 19:20:28 +02:00
parent 651daa69d9
commit c59cfeb18a
No known key found for this signature in database
GPG key ID: F941078878347C0C

View file

@ -284,6 +284,7 @@ class PageController extends Controller {
}
if ($this->hasUserAccess($form)) {
$renderAs = $this->userId !== null ? 'user' : 'public';
return new TemplateResponse('forms', 'vote.tmpl', [
'form' => $form,
'questions' => $this->getQuestions($form->getId()),
@ -294,7 +295,7 @@ class PageController extends Controller {
'userMgr' => $this->userMgr,
'urlGenerator' => $this->urlGenerator,
'avatarManager' => $this->avatarManager
]);
], $renderAs);
} else {
User::checkLoggedIn();
return new TemplateResponse('forms', 'no.acc.tmpl', []);