41 lines
677 B
PHP
41 lines
677 B
PHP
<?php
|
|
/**
|
|
* Created by Pensare Software.
|
|
* User: Theo Weijmer
|
|
* Date: 19/12/2017
|
|
* Time: 17:13
|
|
*/
|
|
|
|
class RetrieveUserSession {
|
|
|
|
private $ci;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->ci =& get_instance();
|
|
}
|
|
|
|
public function handle()
|
|
{
|
|
$this->setUserID();
|
|
|
|
$this->setRole();
|
|
|
|
$this->setAuthenticated();
|
|
}
|
|
|
|
private function setUserID()
|
|
{
|
|
define( 'USERID', $this->ci->session->userID );
|
|
}
|
|
|
|
private function setRole()
|
|
{
|
|
define( 'ROLE', $this->ci->session->role );
|
|
}
|
|
|
|
private function setAuthenticated()
|
|
{
|
|
define( 'AUTHENTICATED', USERID ? TRUE : FALSE );
|
|
}
|
|
} |