Login ready
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?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 );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user