| Total Complexity | 6 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 3 | class oidc extends Controller { |
||
| 4 | |||
| 5 | function __construct() { |
||
|
|
|||
| 6 | $this->load_library("auth_lib"); |
||
| 7 | $this->load_library("http_lib", "http"); |
||
| 8 | $this->load_library("session_lib"); |
||
| 9 | } |
||
| 10 | |||
| 11 | function index() { |
||
| 13 | } |
||
| 14 | |||
| 15 | function login() { |
||
| 16 | if (!empty($_GET['next'])) { |
||
| 17 | $next_url = base_url() . $_GET['next']; |
||
| 18 | $this->session_lib->flash_set("auth_next_page", $next_url); |
||
| 19 | } |
||
| 20 | |||
| 21 | $this->auth_lib->force_authentication(); |
||
| 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); |
||
| 28 | } |
||
| 29 | |||
| 30 | function logout() { |
||
| 32 | } |
||
| 33 | } |
||
| 34 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.