mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Cleanup some code
This commit is contained in:
parent
2a3e22344e
commit
f44507a69b
4 changed files with 6 additions and 41 deletions
|
|
@ -919,10 +919,9 @@ class Actions
|
||||||
$aResult['Language'] = $this->ValidateLanguage($sLanguage, '', false);
|
$aResult['Language'] = $this->ValidateLanguage($sLanguage, '', false);
|
||||||
$aResult['UserLanguage'] = $this->ValidateLanguage($UserLanguageRaw, '', false, true);
|
$aResult['UserLanguage'] = $this->ValidateLanguage($UserLanguageRaw, '', false, true);
|
||||||
|
|
||||||
$aResult['PluginsLink'] = '';
|
$aResult['PluginsLink'] = $this->oPlugins->HaveJs($bAdmin)
|
||||||
if (0 < $this->oPlugins->Count() && $this->oPlugins->HaveJs($bAdmin)) {
|
? './?/Plugins/0/' . ($bAdmin ? 'Admin' : 'User') . '/' . $sStaticCache . '/'
|
||||||
$aResult['PluginsLink'] = './?/Plugins/0/' . ($bAdmin ? 'Admin' : 'User') . '/' . $sStaticCache . '/';
|
: '';
|
||||||
}
|
|
||||||
|
|
||||||
$bAppJsDebug = $this->oConfig->Get('labs', 'use_app_debug_js', false);
|
$bAppJsDebug = $this->oConfig->Get('labs', 'use_app_debug_js', false);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ class Manager
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->Actions()->Logger()->Write('Cannot get installed plugins from '.APP_PLUGINS_PATH,
|
$this->oActions->Logger()->Write('Cannot get installed plugins from '.APP_PLUGINS_PATH,
|
||||||
\MailSo\Log\Enumerations\Type::ERROR);
|
\MailSo\Log\Enumerations\Type::ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -262,38 +262,4 @@ abstract class Repository
|
||||||
return $bResult;
|
return $bResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function pluginEnable(string $sName, bool $bEnable = true) : bool
|
|
||||||
{
|
|
||||||
if (!\strlen($sName))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$oConfig = \RainLoop\Api::Config();
|
|
||||||
|
|
||||||
$sEnabledPlugins = $oConfig->Get('plugins', 'enabled_list', '');
|
|
||||||
$aEnabledPlugins = \explode(',', \strtolower($sEnabledPlugins));
|
|
||||||
$aEnabledPlugins = \array_map('trim', $aEnabledPlugins);
|
|
||||||
|
|
||||||
$aNewEnabledPlugins = array();
|
|
||||||
if ($bEnable)
|
|
||||||
{
|
|
||||||
$aNewEnabledPlugins = $aEnabledPlugins;
|
|
||||||
$aNewEnabledPlugins[] = $sName;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach ($aEnabledPlugins as $sPlugin)
|
|
||||||
{
|
|
||||||
if ($sName !== $sPlugin && \strlen($sPlugin))
|
|
||||||
{
|
|
||||||
$aNewEnabledPlugins[] = $sPlugin;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$oConfig->Set('plugins', 'enabled_list', \trim(\implode(',', \array_unique($aNewEnabledPlugins)), ' ,'));
|
|
||||||
|
|
||||||
return $oConfig->Save();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -146,13 +146,13 @@ abstract class Upgrade
|
||||||
/**
|
/**
|
||||||
* Decodes old less secure data
|
* Decodes old less secure data
|
||||||
*/
|
*/
|
||||||
private static function DecodeKeyValues(string $sData, string $sCustomKey = '') : array
|
private static function DecodeKeyValues(string $sData) : array
|
||||||
{
|
{
|
||||||
$sData = \MailSo\Base\Utils::UrlSafeBase64Decode($sData);
|
$sData = \MailSo\Base\Utils::UrlSafeBase64Decode($sData);
|
||||||
if (!\strlen($sData)) {
|
if (!\strlen($sData)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
$sKey = \md5(APP_SALT . $sCustomKey);
|
$sKey = \md5(APP_SALT);
|
||||||
$sData = \is_callable('xxtea_decrypt')
|
$sData = \is_callable('xxtea_decrypt')
|
||||||
? \xxtea_decrypt($sData, $sKey)
|
? \xxtea_decrypt($sData, $sKey)
|
||||||
: \MailSo\Base\Xxtea::decrypt($sData, $sKey);
|
: \MailSo\Base\Xxtea::decrypt($sData, $sKey);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue