mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 00:54:27 +00:00
Message
This commit is contained in:
@@ -6,10 +6,9 @@ class APIv1_Controller extends REST_Controller
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
//$this->load->library('session'); // -> autoload
|
||||
//$this->load->library('database'); -> autoload
|
||||
|
||||
parent::__construct();
|
||||
//$this->load->library('session'); // -> autoload
|
||||
//$this->load->library('database'); -> autoload
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,9 +3,20 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class FHC_Controller extends CI_Controller
|
||||
{
|
||||
public $uid;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->library('template');
|
||||
$this->load->library('session');
|
||||
//$this->load->helper('language');
|
||||
|
||||
// look if User is logged in and set uid
|
||||
if (isset($_SERVER['PHP_AUTH_USER']))
|
||||
$this->uid = $_SERVER['PHP_AUTH_USER'];
|
||||
if (isset($_SESSION['uid']))
|
||||
$this->uid = $_SESSION['uid'];
|
||||
$this->session->set_userdata('uid', 'pam');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,15 +14,11 @@ class FHC_Model extends CI_Model
|
||||
$uid = null;
|
||||
|
||||
// Get UID from CI session
|
||||
if(isset($this->session->uid))
|
||||
{
|
||||
if(isset($_SESSION['uid']))
|
||||
$uid = $this->session->uid;
|
||||
}
|
||||
// Get UID from the environment (HTTP authentication via authentication.class.php)
|
||||
else if(isset($_SERVER['PHP_AUTH_USER']))
|
||||
{
|
||||
elseif(isset($_SERVER['PHP_AUTH_USER']))
|
||||
$uid = $_SERVER['PHP_AUTH_USER'];
|
||||
}
|
||||
|
||||
$this->load->library('FHC_DB_ACL', array('uid' => $uid));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user