oidc   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
dl 0
loc 29
rs 10
c 1
b 0
f 0
wmc 6

4 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 2 1
A logout() 0 2 1
A __construct() 0 4 1
A login() 0 13 3
1
<?php
2
3
class oidc extends Controller {
4
5
    function __construct() {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
6
        $this->load_library("auth_lib");
7
        $this->load_library("http_lib", "http");
8
        $this->load_library("session_lib");
9
    }
10
11
    function index() {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
12
        $this->http->redirect(locale_base_url() . "oidc/login/");
0 ignored issues
show
Bug Best Practice introduced by
The property http does not exist on oidc. Did you maybe forget to declare it?
Loading history...
13
    }
14
15
    function login() {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
16
        if (!empty($_GET['next'])) {
17
            $next_url = base_url() . $_GET['next'];
18
            $this->session_lib->flash_set("auth_next_page", $next_url);
0 ignored issues
show
Bug Best Practice introduced by
The property session_lib does not exist on oidc. Did you maybe forget to declare it?
Loading history...
19
        }
20
21
        $this->auth_lib->force_authentication();
0 ignored issues
show
Bug Best Practice introduced by
The property auth_lib does not exist on oidc. Did you maybe forget to declare it?
Loading history...
22
23
        $next_page = $this->session_lib->flash_get("auth_next_page");
24
        if (empty($next_page)) {
25
            $next_page = locale_base_url();
26
        }
27
        $this->http->redirect($next_page);
0 ignored issues
show
Bug Best Practice introduced by
The property http does not exist on oidc. Did you maybe forget to declare it?
Loading history...
28
    }
29
30
    function logout() {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
31
        $this->auth_lib->logout();
0 ignored issues
show
Bug Best Practice introduced by
The property auth_lib does not exist on oidc. Did you maybe forget to declare it?
Loading history...
32
    }
33
}
34