Now the helper message is loaded only by these controllers and models:

- APIv1_Controller
- FHC_Controller
- MessageToken_model
This commit is contained in:
Paolo
2018-06-27 11:10:40 +02:00
parent 581cb69a6f
commit d8bcc25ac2
8 changed files with 57 additions and 70 deletions
+12 -15
View File
@@ -10,16 +10,13 @@ class FS_Model extends FHC_Model
public function __construct($filepath = null)
{
parent::__construct();
// Load the filesystem library
$this->load->library('FilesystemLib');
// Load return message helper
$this->load->helper('message');
$this->filepath = $filepath;
}
/** ---------------------------------------------------------------
* Read data from file system
*
@@ -29,13 +26,13 @@ class FS_Model extends FHC_Model
{
// Check Class-Attributes
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
// Check method parameters
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
// Check rights
if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
if (!is_null($data = $this->filesystemlib->read($this->filepath, $filename)))
{
return success(base64_encode($data));
@@ -45,7 +42,7 @@ class FS_Model extends FHC_Model
return error(FHC_MODEL_ERROR, FHC_ERROR);
}
}
/** ---------------------------------------------------------------
* Writing data to file system
*
@@ -56,7 +53,7 @@ class FS_Model extends FHC_Model
{
// Check Class-Attributes
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
// Check method parameters
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
if (is_null($content)) return error(FHC_MODEL_ERROR, FHC_ERROR);
@@ -84,7 +81,7 @@ class FS_Model extends FHC_Model
{
// Check Class-Attributes
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
// Check method parameters
if (is_null($content)) return error(FHC_MODEL_ERROR, FHC_ERROR);
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
@@ -112,7 +109,7 @@ class FS_Model extends FHC_Model
{
// Check Class-Attributes
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
// Check method parameters
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
@@ -128,7 +125,7 @@ class FS_Model extends FHC_Model
return error(FHC_MODEL_ERROR, FHC_ERROR);
}
}
/** ---------------------------------------------------------------
* Rename a file
*
@@ -139,11 +136,11 @@ class FS_Model extends FHC_Model
{
// Check Class-Attributes
if (is_null($this->filepath)) return error(FHC_MODEL_ERROR, FHC_ERROR);
// Check method parameters
if (is_null($filename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
if (is_null($newFilename)) return error(FHC_MODEL_ERROR, FHC_ERROR);
// Check rights
if (isError($ent = $this->isEntitled($this->filepath, PermissionLib::UPDATE_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;