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:
parent
651daa69d9
commit
c59cfeb18a
|
@ -284,6 +284,7 @@ class PageController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->hasUserAccess($form)) {
|
if ($this->hasUserAccess($form)) {
|
||||||
|
$renderAs = $this->userId !== null ? 'user' : 'public';
|
||||||
return new TemplateResponse('forms', 'vote.tmpl', [
|
return new TemplateResponse('forms', 'vote.tmpl', [
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
'questions' => $this->getQuestions($form->getId()),
|
'questions' => $this->getQuestions($form->getId()),
|
||||||
|
@ -294,7 +295,7 @@ class PageController extends Controller {
|
||||||
'userMgr' => $this->userMgr,
|
'userMgr' => $this->userMgr,
|
||||||
'urlGenerator' => $this->urlGenerator,
|
'urlGenerator' => $this->urlGenerator,
|
||||||
'avatarManager' => $this->avatarManager
|
'avatarManager' => $this->avatarManager
|
||||||
]);
|
], $renderAs);
|
||||||
} else {
|
} else {
|
||||||
User::checkLoggedIn();
|
User::checkLoggedIn();
|
||||||
return new TemplateResponse('forms', 'no.acc.tmpl', []);
|
return new TemplateResponse('forms', 'no.acc.tmpl', []);
|
||||||
|
|
Loading…
Reference in a new issue