Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
CatoTH committed Feb 13, 2021
1 parent 8fdb490 commit d8a3750
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions controllers/PagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

class PagesController extends Base
{
public function actionListPages(): string
public function actionListPages(): Response
{
if (!User::havePrivilege($this->consultation, User::PRIVILEGE_CONTENT_EDIT)) {
$this->showErrorpage(403, 'No permissions to edit this page');

return '';
return \Yii::$app->response;
}

if (\Yii::$app->request->post('create')) {
Expand All @@ -42,7 +42,8 @@ public function actionListPages(): string
}
}

return $this->render('list');
\Yii::$app->response->data = $this->render('list');
return \Yii::$app->response;
}

public function actionShowPage(string $pageSlug): string
Expand All @@ -55,6 +56,7 @@ public function actionShowPage(string $pageSlug): string
if ($pageData->consultation && !in_array($pageSlug, $allowedPages)) {
if ($this->testMaintenanceMode() || $this->testSiteForcedLogin()) {
$this->showErrorpage(404, 'Page not found');
return '';
}
}

Expand Down

0 comments on commit d8a3750

Please sign in to comment.