mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 16:07:03 +03:00
Bugfix: Remove inactive/removed plugins from enabled_list
This commit is contained in:
parent
6d0fa33022
commit
dade7756f8
2 changed files with 19 additions and 21 deletions
|
|
@ -835,8 +835,7 @@ trait Admin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$aNewEnabledPlugins = \array_unique($aNewEnabledPlugins);
|
$oConfig->Set('plugins', 'enabled_list', \trim(\implode(',', \array_unique($aNewEnabledPlugins)), ' ,'));
|
||||||
$oConfig->Set('plugins', 'enabled_list', \trim(\implode(',', $aNewEnabledPlugins), ' ,'));
|
|
||||||
|
|
||||||
return $oConfig->Save();
|
return $oConfig->Save();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,28 +80,27 @@ class Manager
|
||||||
$this->aAdditionalJson = array();
|
$this->aAdditionalJson = array();
|
||||||
$this->aProcessTemplate = array();
|
$this->aProcessTemplate = array();
|
||||||
|
|
||||||
$this->bIsEnabled = (bool) $this->oActions->Config()->Get('plugins', 'enable', false);
|
$oConfig = $this->oActions->Config();
|
||||||
if ($this->bIsEnabled)
|
$this->bIsEnabled = (bool) $oConfig->Get('plugins', 'enable', false);
|
||||||
{
|
if ($this->bIsEnabled) {
|
||||||
$sList = \strtolower($this->oActions->Config()->Get('plugins', 'enabled_list', ''));
|
$sList = $oConfig->Get('plugins', 'enabled_list', '');
|
||||||
if (0 < \strlen($sList))
|
if (0 < \strlen($sList)) {
|
||||||
{
|
$aList = \array_map('trim', \explode(',', $sList));
|
||||||
$aList = \explode(',', $sList);
|
foreach ($aList as $i => $sName) {
|
||||||
$aList = \array_map('trim', $aList);
|
$oPlugin = $this->CreatePluginByName($sName);
|
||||||
|
if ($oPlugin) {
|
||||||
|
$oPlugin->Init();
|
||||||
|
|
||||||
foreach ($aList as $sName)
|
$this->aPlugins[] = $oPlugin;
|
||||||
{
|
} else {
|
||||||
if (0 < \strlen($sName))
|
unset($aList[$i]);
|
||||||
{
|
|
||||||
$oPlugin = $this->CreatePluginByName($sName);
|
|
||||||
if ($oPlugin)
|
|
||||||
{
|
|
||||||
$oPlugin->Init();
|
|
||||||
|
|
||||||
$this->aPlugins[] = $oPlugin;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$aList = \implode(',', \array_unique($aList));
|
||||||
|
if ($sList != $aList) {
|
||||||
|
$oConfig->Set('plugins', 'enabled_list', $aList);
|
||||||
|
$oConfig->Save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->RunHook('api.bootstrap.plugins');
|
$this->RunHook('api.bootstrap.plugins');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue