summaryrefslogtreecommitdiff
path: root/app/Controller/AppController.php
blob: 60bc154ab5300b6353b5f6a680293aef515a376c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php

namespace Kanboard\Controller;

use Kanboard\Core\Base;

/**
 * Class AppController
 *
 * @package Kanboard\Controller
 */
class AppController extends Base
{
    /**
     * Forbidden page
     *
     * @access public
     * @param  bool $withoutLayout
     */
    public function accessForbidden($withoutLayout = false)
    {
        if ($this->request->isAjax()) {
            $this->response->json(array('message' => 'Access Forbidden'), 403);
        }

        $this->response->html($this->helper->layout->app('app/forbidden', array(
            'title' => t('Access Forbidden'),
            'no_layout' => $withoutLayout,
        )));
    }

    /**
     * Page not found
     *
     * @access public
     * @param  boolean $withoutLayout
     */
    public function notFound($withoutLayout = false)
    {
        $this->response->html($this->helper->layout->app('app/notfound', array(
            'title' => t('Page not found'),
            'no_layout' => $withoutLayout,
        )));
    }
}