mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
- Removed file system execute permission for all files (no directories)
- application/extensions file system permission now is 775 - application/logs file system permission now is 775 - Added extensions directory in application/: config, controllers, helpers, hooks, libraries, models, views and widgets - Added view views/extensions/manage.php - Added controller controllers/system/extensions/Manager.php - Added library ExtensionsLib to manage extensions - Added model models/system/Extensions_model.php - Moved code related to print out info from MigrationLib to EPrintfLib
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
class Extensions_model extends DB_Model
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'system.tbl_extensions';
|
||||
$this->pk = 'extension_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* getDependencies
|
||||
*/
|
||||
public function getDependencies($dependencies)
|
||||
{
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
return $this->execQuery(
|
||||
'SELECT *
|
||||
FROM '.$this->dbTable.'
|
||||
WHERE enabled = TRUE
|
||||
AND name IN ?',
|
||||
array('name' => $dependencies)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getInstalledExtensions()
|
||||
{
|
||||
$query = 'SELECT extension_id, e1.name, e1.version, description, license, url, core_version, dependencies, enabled
|
||||
FROM system.tbl_extensions e1
|
||||
INNER JOIN (
|
||||
SELECT name, MAX(version) AS version
|
||||
FROM system.tbl_extensions
|
||||
GROUP BY name) e2
|
||||
ON (e1.name = e2.name AND e1.version = e2.version)';
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function executeQuery($sql)
|
||||
{
|
||||
if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent;
|
||||
|
||||
return $this->execQuery($sql);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user