Completed
Push — master ( f8decb...0d0ae6 )
by Arnaud
15s
created

Home::index()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 10
nc 3
nop 0
dl 0
loc 15
rs 9.9332
c 0
b 0
f 0
1
<?php
2
3
namespace App\Controllers\Admin;
4
5
6
7
class Home extends \Core\AdminController
8
{
9
    public function index()
10
    {
11
        //testing auth
12
        if ($this->auth->isAdmin()) {
13
            $this->data['userRole'] = 'Admin';
14
            $this->data['userLevel'] = $this->auth->getUserLevel();
15
        } elseif ($this->auth->isUser()) {
16
            $this->data['userRole'] = 'User';
17
            $this->data['userLevel'] = $this->auth->getUserLevel();
18
        }else {
19
            $this->alertBox->setAlert("You must be connected to acces the admin interface", 'warning');
20
            $this->container->getResponse()->redirect();
21
        }
22
23
        $this->renderView('Admin/Home');
24
25
    }
26
}