mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
- application/core/* -> CS compliant
- application/libraries/* -> CS compliant - FHC_Model isEntitled method now return error() or success() - Updated all code that uses isEntitled method from FHC_Model - Removed Squiz.PHP.DisallowSizeFunctionsInLoops from CS ruleset - Removed depracated method replace from DB_Model - Removed unused method pgArrayPhp from DB_Model - Renamed method arrayMergeIndex to _arrayCombine in DB_Model and set as private - Added method _manageUDFs to DB_Model (a wrapper for UDFLib->manageUDFs)
This commit is contained in:
@@ -4,7 +4,12 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class FHC_Model extends CI_Model
|
||||
{
|
||||
function __construct()
|
||||
/**
|
||||
* Standard constructor for all the models
|
||||
* It loads the helper message to manage the values returned by methods
|
||||
* It loads the permission library
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
@@ -25,19 +30,20 @@ class FHC_Model extends CI_Model
|
||||
*/
|
||||
public function isEntitled($sourceName, $accessType, $languageMessageCode, $msgErrorCode)
|
||||
{
|
||||
$isEntitled = success(true);
|
||||
|
||||
if ($this->permissionlib->isEntitled($sourceName, $accessType) === false)
|
||||
{
|
||||
$retval = sprintf(
|
||||
'%s -> %s:%s',
|
||||
lang('fhc_' . $languageMessageCode),
|
||||
lang('fhc_'.$languageMessageCode),
|
||||
$this->permissionlib->getBerechtigungKurzbz($sourceName),
|
||||
$accessType
|
||||
);
|
||||
return error($retval, $msgErrorCode);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
|
||||
$isEntitled = error($retval, $msgErrorCode);
|
||||
}
|
||||
|
||||
return $isEntitled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user