Passed
Push — Auth ( c6ffd2...76831f )
by Stone
02:02
created

Home::index()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Controllers\Admin;
4
5
6
7
use Core\Container;
8
9
class Home extends \Core\AdminController
10
{
11
    protected $siteConfig;
12
13
    public function __construct(Container $container)
14
    {
15
        $this->loadModules[] = 'SiteConfig';
16
        parent::__construct($container);
17
    }
18
19
    /**
20
     * The front page of the admin section
21
     * @throws \ReflectionException
22
     * @throws \Twig_Error_Loader
23
     * @throws \Twig_Error_Runtime
24
     * @throws \Twig_Error_Syntax
25
     */
26
    public function index()
27
    {
28
        if(!$this->auth->isUser()){
29
            $this->alertBox->setAlert("You must be connected to access the admin interface", 'warning');
30
            $this->container->getResponse()->redirect();
31
        }
32
33
        $this->renderView('Admin/Home');
34
35
    }
36
}