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

Home   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 8 2
A __construct() 0 4 1
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
}