mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 07:52:16 +00:00
Merge branch 'master' into ciauth
This commit is contained in:
@@ -59,17 +59,29 @@ class ExtensionsLib
|
||||
|
||||
/**
|
||||
* Main method to install an extension
|
||||
* If no filename / Extensionname is provided the extension should be uploaded via webupload
|
||||
*
|
||||
* @param $extensionName string Name of Extension (optional)
|
||||
* @param $filename Path to tgz Extension File (optional)
|
||||
*/
|
||||
public function installExtension()
|
||||
public function installExtension($extensionName = null, $filename = null)
|
||||
{
|
||||
$extensionDB = null; // contains data from DB about an extension
|
||||
$extensionJson = null; // contains the extension.json data
|
||||
|
||||
$this->_printInfo('WARNING!!! Please do not change page or stop this procedure before it is finished');
|
||||
|
||||
$this->_loadUploadLibrary(); // loads CI upload library
|
||||
|
||||
$uploadData = $this->_uploadExtension(); // perform the upload of the file and returns info about it
|
||||
if (!is_null($extensionName) && !is_null($filename))
|
||||
{
|
||||
$uploadData = new stdClass();
|
||||
$uploadData->fullPath = $filename;
|
||||
$uploadData->extensionName = $extensionName;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_loadUploadLibrary(); // loads CI upload library
|
||||
$uploadData = $this->_uploadExtension(); // perform the upload of the file and returns info about it
|
||||
}
|
||||
|
||||
if ($uploadData != null) // if no error occurred
|
||||
{
|
||||
|
||||
@@ -112,11 +112,12 @@ class PermissionLib
|
||||
public function isEntitled($requiredPermissions, $calledMethod)
|
||||
{
|
||||
$checkPermissions = false;
|
||||
$requestMethod = $_SERVER['REQUEST_METHOD'];
|
||||
|
||||
// If it's called from command line than it's trusted
|
||||
if (is_cli()) return true;
|
||||
|
||||
$requestMethod = $_SERVER['REQUEST_METHOD'];
|
||||
|
||||
// Checks if the parameter $requiredPermissions is set, is an array and contains at least one element
|
||||
if (isset($requiredPermissions) && !isEmptyArray($requiredPermissions))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user