BaseControllerConcept into config.php

This commit is contained in:
Paminger
2016-03-15 08:14:05 +01:00
parent d28f79e855
commit 0c3c47f848
11 changed files with 50 additions and 327 deletions
@@ -1,14 +1,6 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class MY_Controller extends CI_Controller
{
function __construct()
{
parent::__construct();
}
}
// This can be removed if you use __autoload() in config.php OR use Modular Extensions
require APPPATH . '/libraries/REST_Controller.php';
+11
View File
@@ -0,0 +1,11 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class FHC_Controller extends CI_Controller
{
function __construct()
{
parent::__construct();
}
}
@@ -1,7 +1,7 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class MY_Model extends CI_Model
class FHC_Model extends CI_Model
{
function __construct()
{
@@ -9,14 +9,20 @@ class MY_Model extends CI_Model
}
}
class DB_Model extends MY_Model
class DB_Model extends FHC_Model
{
function __construct($uid=null)
{
parent::__construct();
$this->load->database();
// UID must be set in Production Mode
if (ENVIRONMENT=='production' && is_null($uid))
log_message('error', 'UID must be set in Production Mode.');
elseif (is_null($uid))
log_message('info', 'UID is not set.');
// Loading Tools for Access Control (Benutzerberechtigungen)
$this->load->library('FHC_DB_ACL',array('uid' => $uid));
}
}