fix for plugins multitenant
This commit is contained in:
@@ -81,10 +81,11 @@ try {
|
||||
|
||||
//are all the plugins that are enabled in the workspace
|
||||
$pluginRegistry = ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
foreach ($pluginRegistry->getPlugins() as $plugin) {
|
||||
if ($plugin->enabled && !in_array($plugin->sNamespace, $licenseManager->features)) {
|
||||
$pluginRegistry->disablePlugin($plugin->sNamespace);
|
||||
$pluginRegistry->savePlugin($plugin->sNamespace);
|
||||
/** @var \ProcessMaker\Plugins\Interfaces\PluginDetail $plugin */
|
||||
foreach ($pluginRegistry->getAllPluginsDetails() as $plugin) {
|
||||
if ($plugin->isEnabled() && !in_array($plugin->getNamespace(), $licenseManager->features)) {
|
||||
$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
|
||||
$pluginRegistry = ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
/** @var \ProcessMaker\Plugins\Interfaces\PluginDetail $plugin */
|
||||
foreach ($pluginRegistry->getPlugins() as $plugin) {
|
||||
if ($plugin->enabled && !in_array($plugin->sNamespace, $licenseManager->features)) {
|
||||
$pluginRegistry->disablePlugin($plugin->sNamespace);
|
||||
$pluginRegistry->savePlugin($plugin->sNamespace);
|
||||
foreach ($pluginRegistry->getAllPluginsDetails() as $plugin) {
|
||||
if ($plugin->isEnabled() && !in_array($plugin->getNamespace(), $licenseManager->features)) {
|
||||
$pluginRegistry->disablePlugin($plugin->getNamespace());
|
||||
$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
|
||||
* @param string $name Name of Plugin
|
||||
|
||||
@@ -70,6 +70,15 @@ trait PluginStructure
|
||||
/** @var array Service enabled added */
|
||||
private $_restServiceEnabled = array();
|
||||
|
||||
/**
|
||||
* Get information of all Plugins
|
||||
* @return array
|
||||
*/
|
||||
public function getAllPluginsDetails()
|
||||
{
|
||||
return $this->_aPluginDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get information of all Plugins
|
||||
* @return array
|
||||
|
||||
Reference in New Issue
Block a user