mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 09:52:22 +00:00
Merge branch 'ci' of https://github.com/FH-Complete/FHC-Core into ci
Conflicts: application/config/fhcomplete.php application/core/FHC_Model.php
This commit is contained in:
@@ -10,7 +10,9 @@
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
*/
|
||||
defined('FCPATH') OR exit('No direct script access allowed');
|
||||
if (! defined('FCPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
require_once(FCPATH.'include/basis_db.class.php');
|
||||
require_once(FCPATH.'include/organisationseinheit.class.php');
|
||||
require_once(FCPATH.'include/studiengang.class.php');
|
||||
@@ -43,10 +45,11 @@ class FHC_DB_ACL
|
||||
* @param string $password
|
||||
* @return bool
|
||||
*/
|
||||
function __construct($param)
|
||||
function __construct($param = null)
|
||||
{
|
||||
$this->bb = new benutzerberechtigung();
|
||||
$this->_uid = $param['uid'];
|
||||
if (is_array($param) && isset($param['uid']))
|
||||
$this->_uid = $param['uid'];
|
||||
}
|
||||
|
||||
function isBerechtigt($berechtigung_kurzbz, $art=null, $oe_kurzbz=null, $kostenstelle_id=null)
|
||||
|
||||
@@ -355,7 +355,7 @@ abstract class REST_Controller extends CI_Controller {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected $_addonID = NULL;
|
||||
protected $_uid = NULL;
|
||||
|
||||
/**
|
||||
* Extend this function to apply additional checking early on in the process
|
||||
@@ -727,7 +727,6 @@ abstract class REST_Controller extends CI_Controller {
|
||||
|
||||
// Set the output as NULL by default
|
||||
$output = NULL;
|
||||
|
||||
// If data is NULL and no HTTP status code provided, then display, error and exit
|
||||
if ($data === NULL && $http_code === NULL)
|
||||
{
|
||||
@@ -743,7 +742,7 @@ abstract class REST_Controller extends CI_Controller {
|
||||
// Set the format header
|
||||
$this->output->set_content_type($this->_supported_formats[$this->response->format], strtolower($this->config->item('charset')));
|
||||
$output = $this->format->factory($data)->{'to_' . $this->response->format}();
|
||||
|
||||
|
||||
// An array must be parsed as a string, so as not to cause an array to string error
|
||||
// Json is the most appropriate form for such a datatype
|
||||
if ($this->response->format === 'array')
|
||||
@@ -758,7 +757,6 @@ abstract class REST_Controller extends CI_Controller {
|
||||
{
|
||||
$data = $this->format->factory($data)->{'to_json'}();
|
||||
}
|
||||
|
||||
// Format is not supported, so output the raw data as a string
|
||||
$output = $data;
|
||||
}
|
||||
@@ -1911,20 +1909,20 @@ abstract class REST_Controller extends CI_Controller {
|
||||
/**
|
||||
* TO BE COMMENTED
|
||||
*/
|
||||
private function _setAddonID($username)
|
||||
private function _setUID($username)
|
||||
{
|
||||
if(!isset($this->_addonID) && isset($username))
|
||||
if(!isset($this->_uid) && isset($username))
|
||||
{
|
||||
$this->_addonID = $username;
|
||||
$this->_uid = $username;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int ID of the authenticated addon
|
||||
* @return int ID of the authenticated caller
|
||||
*/
|
||||
protected function _getAddonID()
|
||||
protected function _getUID()
|
||||
{
|
||||
return $this->_addonID;
|
||||
return $this->_uid;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1968,7 +1966,7 @@ abstract class REST_Controller extends CI_Controller {
|
||||
}
|
||||
else // If logged
|
||||
{
|
||||
$this->_setAddonID($username);
|
||||
$this->_setUID($username);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user