Merge branch 'master' into ciauth

This commit is contained in:
Paolo
2019-03-21 17:04:51 +01:00
17 changed files with 284 additions and 125 deletions
+16 -4
View File
@@ -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
{
+2 -1
View File
@@ -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))
{