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

Home   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 15 3
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
}