fix for plugins multitenant
This commit is contained in:
@@ -81,10 +81,11 @@ try {
|
|||||||
|
|
||||||
//are all the plugins that are enabled in the workspace
|
//are all the plugins that are enabled in the workspace
|
||||||
$pluginRegistry = ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
$pluginRegistry = ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||||
foreach ($pluginRegistry->getPlugins() as $plugin) {
|
/** @var \ProcessMaker\Plugins\Interfaces\PluginDetail $plugin */
|
||||||
if ($plugin->enabled && !in_array($plugin->sNamespace, $licenseManager->features)) {
|
foreach ($pluginRegistry->getAllPluginsDetails() as $plugin) {
|
||||||
$pluginRegistry->disablePlugin($plugin->sNamespace);
|
if ($plugin->isEnabled() && !in_array($plugin->getNamespace(), $licenseManager->features)) {
|
||||||
$pluginRegistry->savePlugin($plugin->sNamespace);
|
$pluginRegistry->disablePlugin($plugin->getNamespace());
|
||||||
|
$pluginRegistry->savePlugin($plugin->getNamespace());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ if ($aux['extension'] != 'dat') {
|
|||||||
//are all the plugins that are enabled in the workspace
|
//are all the plugins that are enabled in the workspace
|
||||||
$pluginRegistry = ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
$pluginRegistry = ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||||
/** @var \ProcessMaker\Plugins\Interfaces\PluginDetail $plugin */
|
/** @var \ProcessMaker\Plugins\Interfaces\PluginDetail $plugin */
|
||||||
foreach ($pluginRegistry->getPlugins() as $plugin) {
|
foreach ($pluginRegistry->getAllPluginsDetails() as $plugin) {
|
||||||
if ($plugin->enabled && !in_array($plugin->sNamespace, $licenseManager->features)) {
|
if ($plugin->isEnabled() && !in_array($plugin->getNamespace(), $licenseManager->features)) {
|
||||||
$pluginRegistry->disablePlugin($plugin->sNamespace);
|
$pluginRegistry->disablePlugin($plugin->getNamespace());
|
||||||
$pluginRegistry->savePlugin($plugin->sNamespace);
|
$pluginRegistry->savePlugin($plugin->getNamespace());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -268,6 +268,19 @@ class PluginRegistry
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $Namespace
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function checkFilePlugin($Namespace)
|
||||||
|
{
|
||||||
|
if (is_file(PATH_PLUGINS . $Namespace . ".php") && is_dir(PATH_PLUGINS . $Namespace)) {
|
||||||
|
require_once(PATH_PLUGINS . $Namespace . ".php");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get status plugin
|
* Get status plugin
|
||||||
* @param string $name Name of Plugin
|
* @param string $name Name of Plugin
|
||||||
|
|||||||
@@ -70,6 +70,15 @@ trait PluginStructure
|
|||||||
/** @var array Service enabled added */
|
/** @var array Service enabled added */
|
||||||
private $_restServiceEnabled = array();
|
private $_restServiceEnabled = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get information of all Plugins
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getAllPluginsDetails()
|
||||||
|
{
|
||||||
|
return $this->_aPluginDetails;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get information of all Plugins
|
* Get information of all Plugins
|
||||||
* @return array
|
* @return array
|
||||||
|
|||||||
Reference in New Issue
Block a user