diff --git a/application/controllers/system/Filters.php b/application/controllers/system/Filters.php index 1b43e82e1..64626f8db 100644 --- a/application/controllers/system/Filters.php +++ b/application/controllers/system/Filters.php @@ -21,10 +21,6 @@ class Filters extends FHC_Controller { parent::__construct(); - // Loads authentication helper - // NOTE: needed to load custom filters do not remove! - $this->load->helper('fhcauth'); - // Loads the FiltersLib with HTTP GET/POST parameters $this->_loadFiltersLib(); diff --git a/application/libraries/CallerLib.php b/application/libraries/CallerLib.php index 9024c0f09..0b46cf0c6 100644 --- a/application/libraries/CallerLib.php +++ b/application/libraries/CallerLib.php @@ -25,16 +25,14 @@ class CallerLib 'PersonLogLib' ); + private $_ci; // CI instance + /** - * Object initialization + * Library initialization */ public function __construct() { - // Gets CI instance - $this->ci =& get_instance(); - - // Loads permission library - $this->ci->load->library('PermissionLib'); + $this->_ci =& get_instance(); // Gets CI instance } /** @@ -80,7 +78,7 @@ class CallerLib elseif (strpos($parameters->resourceName, CallerLib::LIB_PREFIX) !== false) { // Check if the resource is already loaded, it works only with libraries and drivers - $isLoaded = $this->ci->load->is_loaded($parameters->resourceName); + $isLoaded = $this->_ci->load->is_loaded($parameters->resourceName); // If not loaded then load it if ($isLoaded === false) { @@ -210,7 +208,7 @@ class CallerLib try { - $loaded = $this->ci->load->model($resourcePath.$resourceName); + $loaded = $this->_ci->load->model($resourcePath.$resourceName); } catch (Exception $e) { @@ -245,7 +243,7 @@ class CallerLib try { // Gets all the configured resources paths - $packagePaths = $this->ci->load->get_package_paths(); + $packagePaths = $this->_ci->load->get_package_paths(); // Looking for a file in every paths with the same name of the resource $found = null; for ($i = 0; $i < count($packagePaths) && is_null($found); $i++) @@ -262,7 +260,7 @@ class CallerLib if (!is_null($found)) { // Load the file - $loaded = $this->ci->load->file($found); + $loaded = $this->_ci->load->file($found); // If the resource is not present inside the file if (!class_exists($resourceName)) { diff --git a/application/libraries/FiltersLib.php b/application/libraries/FiltersLib.php index 263956e18..32bb82538 100644 --- a/application/libraries/FiltersLib.php +++ b/application/libraries/FiltersLib.php @@ -86,6 +86,9 @@ class FiltersLib { $this->_ci =& get_instance(); // get code igniter instance + // Loads authentication helper + $this->_ci->load->helper('fhcauth'); // NOTE: needed to load custom filters do not remove! + $this->_filterUniqueId = $this->_getFilterUniqueId($params); // sets the id for the related filter widget } @@ -96,6 +99,7 @@ class FiltersLib * Checks if at least one of the permissions given as parameter (requiredPermissions) belongs * to the authenticated user, if confirmed then is allowed to use this FilterWidget. * If the parameter requiredPermissions is NOT given, then no one is allow to use this FilterWidget + * NOTE: PermissionLib is loaded hedere */ public function isAllowed($requiredPermissions = null) { diff --git a/application/libraries/PhrasesLib.php b/application/libraries/PhrasesLib.php index e8582f65b..93250379b 100644 --- a/application/libraries/PhrasesLib.php +++ b/application/libraries/PhrasesLib.php @@ -249,6 +249,8 @@ class PhrasesLib $language = $parameters[1]; } // Checks if the user is authenticated to retrive the users's language + // NOTE: this library could be called when the user is not logged in the system + // so this is why is checked if the function getAuthUID exists elseif (function_exists('getAuthUID')) { $this->_ci->load->model('person/Person_model', 'PersonModel');