From 487b755fadef8e342e5f50bdbdd3a0b2e863617c Mon Sep 17 00:00:00 2001 From: Nivesh Krishna Date: Tue, 13 Dec 2022 18:03:52 +0530 Subject: [PATCH 1/2] rename variables --- app/index.php | 8 +- app/rainloop/v/1.16.0/app/handle.php | 4 +- .../v/1.16.0/app/libraries/MailSo/Version.php | 6 +- .../1.16.0/app/libraries/RainLoop/Actions.php | 94 +++++++++---------- .../v/1.16.0/app/libraries/RainLoop/Api.php | 2 +- .../RainLoop/Config/AbstractConfig.php | 4 +- .../libraries/RainLoop/Config/Application.php | 6 +- .../app/libraries/RainLoop/KeyPathHelper.php | 8 +- .../app/libraries/RainLoop/Model/Account.php | 4 +- .../libraries/RainLoop/Plugins/Manager.php | 16 ++-- .../Providers/AddressBook/Classes/Contact.php | 2 +- .../Providers/Domain/DefaultDomain.php | 2 +- .../TwoFactorAuth/GoogleTwoFactorAuth.php | 4 +- .../1.16.0/app/libraries/RainLoop/Service.php | 10 +- .../app/libraries/RainLoop/ServiceActions.php | 30 +++--- .../1.16.0/app/libraries/RainLoop/Social.php | 22 ++--- .../v/1.16.0/app/libraries/RainLoop/Utils.php | 26 ++--- app/rainloop/v/1.16.0/check.php | 2 +- app/rainloop/v/1.16.0/include.php | 86 ++++++++--------- app/rainloop/v/1.16.0/index.php.root | 8 +- 20 files changed, 172 insertions(+), 172 deletions(-) diff --git a/app/index.php b/app/index.php index 289ea3a..88aeb13 100644 --- a/app/index.php +++ b/app/index.php @@ -10,17 +10,17 @@ if (!@function_exists('__get_custom_data_full_path')) } } -if (!defined('APP_VERSION')) +if (!defined('R_APP_VERSION')) { - define('APP_VERSION', '1.16.0'); + define('R_APP_VERSION', '1.16.0'); define('APP_VERSION_TYPE', 'community'); define('APP_INDEX_ROOT_FILE', __FILE__); define('APP_INDEX_ROOT_PATH', str_replace('\\', '/', rtrim(dirname(__FILE__), '\\/').'/')); } -if (file_exists(APP_INDEX_ROOT_PATH.'rainloop/v/'.APP_VERSION.'/include.php')) +if (file_exists(APP_INDEX_ROOT_PATH.'rainloop/v/'.R_APP_VERSION.'/include.php')) { - include APP_INDEX_ROOT_PATH.'rainloop/v/'.APP_VERSION.'/include.php'; + include APP_INDEX_ROOT_PATH.'rainloop/v/'.R_APP_VERSION.'/include.php'; } else { diff --git a/app/rainloop/v/1.16.0/app/handle.php b/app/rainloop/v/1.16.0/app/handle.php index ff70c57..6113ef8 100644 --- a/app/rainloop/v/1.16.0/app/handle.php +++ b/app/rainloop/v/1.16.0/app/handle.php @@ -67,12 +67,12 @@ if (\class_exists('RainLoop\Api')) { if (!\class_exists('MailSo\Version', false)) { - include APP_VERSION_ROOT_PATH.'app/libraries/MailSo/MailSo.php'; + include R_APP_VERSION_ROOT_PATH.'app/libraries/MailSo/MailSo.php'; } if (!\function_exists('spyc_load_file')) { - include APP_VERSION_ROOT_PATH.'app/libraries/spyc/Spyc.php'; + include R_APP_VERSION_ROOT_PATH.'app/libraries/spyc/Spyc.php'; } if (\class_exists('MailSo\Version')) diff --git a/app/rainloop/v/1.16.0/app/libraries/MailSo/Version.php b/app/rainloop/v/1.16.0/app/libraries/MailSo/Version.php index f17b287..f6faa11 100644 --- a/app/rainloop/v/1.16.0/app/libraries/MailSo/Version.php +++ b/app/rainloop/v/1.16.0/app/libraries/MailSo/Version.php @@ -19,7 +19,7 @@ final class Version /** * @var string */ - const APP_VERSION = '2.0.1'; + const R_APP_VERSION = '2.0.1'; /** * @var string @@ -31,7 +31,7 @@ final class Version */ public static function AppVersion() { - return \MailSo\Version::APP_VERSION; + return \MailSo\Version::R_APP_VERSION; } /** @@ -39,7 +39,7 @@ final class Version */ public static function XMailer() { - return \MailSo\Version::MIME_X_MAILER.'/'.\MailSo\Version::APP_VERSION; + return \MailSo\Version::MIME_X_MAILER.'/'.\MailSo\Version::R_APP_VERSION; } /** diff --git a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Actions.php b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Actions.php index 7cfa02c..7d54bee 100644 --- a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Actions.php +++ b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Actions.php @@ -273,7 +273,7 @@ class Actions // // if ($bLoaded && !$bSave) // { -// $bSave = APP_VERSION !== $this->oConfig->Get('version', 'current'); +// $bSave = R_APP_VERSION !== $this->oConfig->Get('version', 'current'); // } // // if ($bSave) @@ -305,13 +305,13 @@ class Actions { case 'files': // RainLoop\Providers\Files\IFiles - $mResult = new \RainLoop\Providers\Files\FileStorage(APP_PRIVATE_DATA.'storage/files'); + $mResult = new \RainLoop\Providers\Files\FileStorage(R_APP_PRIVATE_DATA.'storage/files'); break; case 'storage': case 'storage-local': // RainLoop\Providers\Storage\IStorage $mResult = new \RainLoop\Providers\Storage\FileStorage( - APP_PRIVATE_DATA.'storage', 'storage-local' === $sName); + R_APP_PRIVATE_DATA.'storage', 'storage-local' === $sName); break; case 'settings': case 'settings-local': @@ -325,7 +325,7 @@ class Actions break; case 'domain': // \RainLoop\Providers\Domain\DomainAdminInterface - $mResult = new \RainLoop\Providers\Domain\DefaultDomain(APP_PRIVATE_DATA.'domains', $this->Cacher()); + $mResult = new \RainLoop\Providers\Domain\DefaultDomain(R_APP_PRIVATE_DATA.'domains', $this->Cacher()); break; case 'filters': // \RainLoop\Providers\Filters\FiltersInterface @@ -344,7 +344,7 @@ class Actions if ('sqlite' === $sDsnType) { $mResult = new \RainLoop\Providers\AddressBook\PdoAddressBook( - 'sqlite:'.APP_PRIVATE_DATA.'AddressBook.sqlite', '', '', 'sqlite'); + 'sqlite:'.R_APP_PRIVATE_DATA.'AddressBook.sqlite', '', '', 'sqlite'); } else { @@ -736,7 +736,7 @@ class Actions $aAdminHash = \RainLoop\Utils::DecodeKeyValuesQ($this->getAdminAuthToken()); if ( !empty($aAdminHash[0]) && !empty($aAdminHash[1]) && !empty($aAdminHash[2]) && - 'token' === $aAdminHash[0] && \md5(APP_SALT) === $aAdminHash[1] + 'token' === $aAdminHash[0] && \md5(R_APP_SALT) === $aAdminHash[1] ) { $this->Cacher(null, true)->Delete(\RainLoop\KeyPathHelper::SessionAdminKey($aAdminHash[2])); @@ -847,7 +847,7 @@ class Actions { if (null === $this->oPremProvider) { - if (\file_exists(APP_VERSION_ROOT_PATH.'app/libraries/RainLoop/Providers/Prem.php')) + if (\file_exists(R_APP_VERSION_ROOT_PATH.'app/libraries/RainLoop/Providers/Prem.php')) { $this->oPremProvider = new \RainLoop\Providers\Prem( $this->Config(), $this->Logger(), $this->Cacher(null, true) @@ -1021,7 +1021,7 @@ class Actions { default: case $bForceFile: - $oDriver = \MailSo\Cache\Drivers\File::NewInstance(APP_PRIVATE_DATA.'cache', $sKey); + $oDriver = \MailSo\Cache\Drivers\File::NewInstance(R_APP_PRIVATE_DATA.'cache', $sKey); break; case ('APC' === $sDriver || 'APCU' === $sDriver) && @@ -1113,7 +1113,7 @@ class Actions } else { - $sLogFileFullPath = \APP_PRIVATE_DATA.'logs/'.$this->compileLogFileName($sLogFileName); + $sLogFileFullPath = \R_APP_PRIVATE_DATA.'logs/'.$this->compileLogFileName($sLogFileName); $sLogFileDir = \dirname($sLogFileFullPath); if (!@is_dir($sLogFileDir)) @@ -1143,7 +1143,7 @@ class Actions $this->oLogger->Write('[DATE:'.\MailSo\Log\Logger::DateHelper('d.m.y', $sTimeOffset). (0 !== $sTimeOffset ? '][OFFSET:'.(0 < $sTimeOffset ? '+' : '-'). \str_pad((string) \abs($sTimeOffset), 2, '0', STR_PAD_LEFT) : ''). - '][RL:'.APP_VERSION.'][PHP:'.PHP_VERSION.'][IP:'. + '][RL:'.R_APP_VERSION.'][PHP:'.PHP_VERSION.'][IP:'. $oHttp->GetClientIp($this->Config()->Get('labs', 'http_client_ip_check_proxy', false)).'][PID:'. (\MailSo\Base\Utils::FunctionExistsAndEnabled('getmypid') ? \getmypid() : 'unknown').']['. $oHttp->GetServer('SERVER_SOFTWARE', '~').']['. @@ -1181,7 +1181,7 @@ class Actions if (!!$this->Config()->Get('logs', 'auth_logging', false)) { - $sAuthLogFileFullPath = \APP_PRIVATE_DATA.'logs/'.$this->compileLogFileName( + $sAuthLogFileFullPath = \R_APP_PRIVATE_DATA.'logs/'.$this->compileLogFileName( $this->Config()->Get('logs', 'auth_logging_filename', '')); $sLogFileDir = \dirname($sAuthLogFileFullPath); @@ -1235,7 +1235,7 @@ class Actions $sRand = ''; } - return '' === $sRand ? '' : \RainLoop\Utils::EncodeKeyValuesQ(array('token', \md5(APP_SALT), $sRand)); + return '' === $sRand ? '' : \RainLoop\Utils::EncodeKeyValuesQ(array('token', \md5(R_APP_SALT), $sRand)); } /** @@ -1250,7 +1250,7 @@ class Actions { $aAdminHash = \RainLoop\Utils::DecodeKeyValuesQ($this->getAdminAuthToken()); if (!empty($aAdminHash[0]) && !empty($aAdminHash[1]) && !empty($aAdminHash[2]) && - 'token' === $aAdminHash[0] && \md5(APP_SALT) === $aAdminHash[1] && + 'token' === $aAdminHash[0] && \md5(R_APP_SALT) === $aAdminHash[1] && '' !== $this->Cacher(null, true)->Get(\RainLoop\KeyPathHelper::SessionAdminKey($aAdminHash[2]), '') ) { @@ -1467,7 +1467,7 @@ class Actions } return \array_merge(array( - 'version' => APP_VERSION, + 'version' => R_APP_VERSION, 'admin' => $bAdmin, 'mobile' => $bMobile, 'mobileDevice' => $bMobileDevice, @@ -1834,7 +1834,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins $aResult['FacebookAppSecret'] = ''; } - $aResult['ProjectHash'] = \md5($aResult['AccountHash'].APP_VERSION.$this->Plugins()->Hash()); + $aResult['ProjectHash'] = \md5($aResult['AccountHash'].R_APP_VERSION.$this->Plugins()->Hash()); $sLanguage = $oConfig->Get('webmail', 'language', 'en'); $sLanguageAdmin = $oConfig->Get('webmail', 'language_admin', 'en'); @@ -2352,7 +2352,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins $aData = $this->getTwoFactorInfo($oAccount); if ($aData && isset($aData['IsSet'], $aData['Enable']) && !empty($aData['Secret']) && $aData['IsSet'] && $aData['Enable']) { - $sSecretHash = \md5(APP_SALT.$aData['Secret'].\RainLoop\Utils::Fingerprint()); + $sSecretHash = \md5(R_APP_SALT.$aData['Secret'].\RainLoop\Utils::Fingerprint()); $sSecretCookieHash = \RainLoop\Utils::GetCookie(self::AUTH_TFA_SIGN_ME_TOKEN_KEY, ''); if (empty($sSecretCookieHash) || $sSecretHash !== $sSecretCookieHash) @@ -2420,7 +2420,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins */ private function generateSignMeToken($sEmail) { - return \MailSo\Base\Utils::Md5Rand(APP_SALT.$sEmail); + return \MailSo\Base\Utils::Md5Rand(R_APP_SALT.$sEmail); } /** @@ -3044,7 +3044,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins { $oZip = new \ZipArchive(); $oZip->open($sZipFileName, \ZIPARCHIVE::CREATE | \ZIPARCHIVE::OVERWRITE); - $oZip->setArchiveComment('RainLoop/'.APP_VERSION); + $oZip->setArchiveComment('RainLoop/'.R_APP_VERSION); foreach ($aData as $aItem) { @@ -3086,7 +3086,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins 'Files' => array(array( 'FileName' => 'attachments.zip', 'Hash' => \RainLoop\Utils::EncodeKeyValuesQ(array( - 'V' => APP_VERSION, + 'V' => R_APP_VERSION, 'Account' => $oAccount ? \md5($oAccount->Hash()) : '', 'FileName' => 'attachments.zip', 'MimeType' => 'application/zip', @@ -4348,7 +4348,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins return @file_exists(APP_INDEX_ROOT_PATH.'index.php') && @is_writable(APP_INDEX_ROOT_PATH.'index.php') && @is_writable(APP_INDEX_ROOT_PATH.'rainloop/') && - APP_VERSION !== APP_DEV_VERSION + R_APP_VERSION !== APP_DEV_VERSION ; } @@ -4423,12 +4423,12 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins if ($oItem && isset($oItem->type, $oItem->id, $oItem->name, $oItem->version, $oItem->release, $oItem->file, $oItem->description)) { - if (!empty($oItem->required) && APP_DEV_VERSION !== APP_VERSION && version_compare(APP_VERSION, $oItem->required, '<')) + if (!empty($oItem->required) && APP_DEV_VERSION !== R_APP_VERSION && version_compare(R_APP_VERSION, $oItem->required, '<')) { continue; } - if (!empty($oItem->depricated) && APP_DEV_VERSION !== APP_VERSION && version_compare(APP_VERSION, $oItem->depricated, '>=')) + if (!empty($oItem->depricated) && APP_DEV_VERSION !== R_APP_VERSION && version_compare(R_APP_VERSION, $oItem->depricated, '>=')) { continue; } @@ -4627,7 +4627,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins $sWarnings = empty($aData['warnings']) ? '' : $aData['warnings']; $aWarnings = $sWarnings ? explode('|', $sWarnings) : array(); - $sCurrentVersion = APP_VERSION; + $sCurrentVersion = R_APP_VERSION; $bShowWarning = false; if ($sCurrentVersion !== APP_DEV_VERSION) @@ -4713,7 +4713,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins $bResult = false; if ('' !== $sResultId) { - $bResult = \MailSo\Base\Utils::RecRmDir(APP_PLUGINS_PATH.$sResultId); + $bResult = \MailSo\Base\Utils::RecRmDir(R_APP_PLUGINS_PATH.$sResultId); if ($bResult) { $this->pluginEnable($sResultId, false); @@ -4731,7 +4731,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins public function downloadRemotePackageByUrl($sUrl) { $bResult = false; - $sTmp = APP_PRIVATE_DATA.\md5(\microtime(true).$sUrl).'.zip'; + $sTmp = R_APP_PRIVATE_DATA.\md5(\microtime(true).$sUrl).'.zip'; $pDest = @\fopen($sTmp, 'w+b'); if ($pDest) { @@ -4801,15 +4801,15 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins if ('' !== $sTmp) { - include_once APP_VERSION_ROOT_PATH.'app/libraries/pclzip/pclzip.lib.php'; + include_once R_APP_VERSION_ROOT_PATH.'app/libraries/pclzip/pclzip.lib.php'; $oArchive = new \PclZip($sTmp); if ('plugin' === $sType) { $bResult = true; - if (\is_dir(APP_PLUGINS_PATH.$sId)) + if (\is_dir(R_APP_PLUGINS_PATH.$sId)) { - $bResult = \MailSo\Base\Utils::RecRmDir(APP_PLUGINS_PATH.$sId); + $bResult = \MailSo\Base\Utils::RecRmDir(R_APP_PLUGINS_PATH.$sId); if (!$bResult) { $this->Logger()->Write('Cannot remove previous plugin folder: '.$sId, \MailSo\Log\Enumerations\Type::ERROR, 'INSTALLER'); @@ -4818,7 +4818,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins if ($bResult) { - $bResult = 0 !== $oArchive->extract(PCLZIP_OPT_PATH, APP_PLUGINS_PATH); + $bResult = 0 !== $oArchive->extract(PCLZIP_OPT_PATH, R_APP_PLUGINS_PATH); if (!$bResult) { $this->Logger()->Write('Cannot extract package files: '.$oArchive->errorInfo(), \MailSo\Log\Enumerations\Type::ERROR, 'INSTALLER'); @@ -5181,7 +5181,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins public function DoVersion() { return $this->DefaultResponse(__FUNCTION__, - APP_VERSION === (string) $this->GetActionParam('Version', '')); + R_APP_VERSION === (string) $this->GetActionParam('Version', '')); } /** @@ -5756,7 +5756,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins if (\is_array($aInboxInformation)) { - $aInboxInformation['Version'] = APP_VERSION; + $aInboxInformation['Version'] = R_APP_VERSION; } return $this->DefaultResponse(__FUNCTION__, $aInboxInformation); @@ -5771,7 +5771,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins { $aResult = array( 'List' => array(), - 'Version' => APP_VERSION + 'Version' => R_APP_VERSION ); $aFolders = $this->GetActionParam('Folders', null); @@ -5919,7 +5919,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins if (!$this->Config()->Get('security', 'hide_x_mailer_header', false)) { - $oMessage->SetXMailer('RainLoop/'.APP_VERSION); + $oMessage->SetXMailer('RainLoop/'.R_APP_VERSION); } else { $oMessage->DoesNotAddDefaultXMailer(); } @@ -6112,7 +6112,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins if (!$this->Config()->Get('security', 'hide_x_mailer_header', false)) { - $oMessage->SetXMailer('RainLoop/'.APP_VERSION); + $oMessage->SetXMailer('RainLoop/'.R_APP_VERSION); } $oMessage->SetFrom(\MailSo\Mime\Email::NewInstance($oIdentity->Email(), $oIdentity->Name())); @@ -7888,7 +7888,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins $oSettings = $this->SettingsProvider()->Load($oAccount); if ($oSettings) { - $sHash = \MailSo\Base\Utils::Md5Rand($sName.APP_VERSION.APP_SALT); + $sHash = \MailSo\Base\Utils::Md5Rand($sName.R_APP_VERSION.R_APP_SALT); $oSettings->SetConf('UserBackgroundName', $sName); $oSettings->SetConf('UserBackgroundHash', $sHash); @@ -8971,10 +8971,10 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins if (\preg_match('/^[^@]+@([a-z0-9\-\.]+)$/', $sEmail, $aMatch) && !empty($aMatch[1])) { $sDomain = $aMatch[1]; - if (\file_exists(APP_VERSION_ROOT_PATH.'app/resources/images/services/'.$sDomain.'.png')) + if (\file_exists(R_APP_VERSION_ROOT_PATH.'app/resources/images/services/'.$sDomain.'.png')) { $sContentType = 'image/png'; - $sData = \file_get_contents(APP_VERSION_ROOT_PATH.'app/resources/images/services/'.$sDomain.'.png'); + $sData = \file_get_contents(R_APP_VERSION_ROOT_PATH.'app/resources/images/services/'.$sDomain.'.png'); } } } @@ -8983,7 +8983,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins if (empty($sData) || empty($sContentType)) { $sContentType = 'image/png'; - $sData = \file_get_contents(APP_VERSION_ROOT_PATH.'app/resources/images/empty-contact.png'); + $sData = \file_get_contents(R_APP_VERSION_ROOT_PATH.'app/resources/images/empty-contact.png'); } $this->cacheByKey($sRawKey); @@ -9108,7 +9108,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins static $sCache = null; if (!$sCache) { - $sCache = \md5(APP_VERSION.$this->Plugins()->Hash()); + $sCache = \md5(R_APP_VERSION.$this->Plugins()->Hash()); } return $sCache; } @@ -9243,7 +9243,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins $bClear = false; $bDefault = false; $sList = array(); - $sDir = APP_VERSION_ROOT_PATH.'themes'; + $sDir = R_APP_VERSION_ROOT_PATH.'themes'; if (@\is_dir($sDir)) { $rDirH = \opendir($sDir); @@ -9315,7 +9315,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins public function GetLanguages($bAdmin = false) { static $aCache = array(); - $sDir = APP_VERSION_ROOT_PATH.'app/localization/'.($bAdmin ? 'admin' : 'webmail').'/'; + $sDir = R_APP_VERSION_ROOT_PATH.'app/localization/'.($bAdmin ? 'admin' : 'webmail').'/'; if (isset($aCache[$sDir])) { @@ -9683,10 +9683,10 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins $sLang = $this->ValidateLanguage($sLang, 'en'); $aLang = array(); -// \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/i18n/langs.ini', $aLang); -// \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'langs/'.$sLang.'.ini', $aLang); - \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/langs.yml', $aLang); - \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/webmail/'.$sLang.'.yml', $aLang); +// \RainLoop\Utils::ReadAndAddLang(R_APP_VERSION_ROOT_PATH.'app/i18n/langs.ini', $aLang); +// \RainLoop\Utils::ReadAndAddLang(R_APP_VERSION_ROOT_PATH.'langs/'.$sLang.'.ini', $aLang); + \RainLoop\Utils::ReadAndAddLang(R_APP_VERSION_ROOT_PATH.'app/localization/langs.yml', $aLang); + \RainLoop\Utils::ReadAndAddLang(R_APP_VERSION_ROOT_PATH.'app/localization/webmail/'.$sLang.'.yml', $aLang); $this->Plugins()->ReadLang($sLang, $aLang); } @@ -9875,7 +9875,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins $sSubject = $mResult['Subject']; $mResult['Hash'] = \md5($mResult['Folder'].$mResult['Uid']); $mResult['RequestHash'] = \RainLoop\Utils::EncodeKeyValuesQ(array( - 'V' => APP_VERSION, + 'V' => R_APP_VERSION, 'Account' => $oAccount ? \md5($oAccount->Hash()) : '', 'Folder' => $mResult['Folder'], 'Uid' => $mResult['Uid'], @@ -10101,7 +10101,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc LangLink IncludeBackground Plugins } $mResult['Download'] = \RainLoop\Utils::EncodeKeyValuesQ(array( - 'V' => APP_VERSION, + 'V' => R_APP_VERSION, 'Account' => $oAccount ? \md5($oAccount->Hash()) : '', 'Folder' => $mResult['Folder'], 'Uid' => $mResult['Uid'], diff --git a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Api.php b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Api.php index c9a1d7d..bdb6a83 100644 --- a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Api.php +++ b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Api.php @@ -190,7 +190,7 @@ class Api */ public static function Version() { - return APP_VERSION; + return R_APP_VERSION; } /** diff --git a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Config/AbstractConfig.php b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Config/AbstractConfig.php index c945345..6bce400 100644 --- a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Config/AbstractConfig.php +++ b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Config/AbstractConfig.php @@ -38,10 +38,10 @@ abstract class AbstractConfig */ public function __construct($sFileName, $sFileHeader = '', $sAdditionalFileName = '') { - $this->sFile = \APP_PRIVATE_DATA.'configs/'.\trim($sFileName); + $this->sFile = \R_APP_PRIVATE_DATA.'configs/'.\trim($sFileName); $sAdditionalFileName = \trim($sAdditionalFileName); - $this->sAdditionalFile = \APP_PRIVATE_DATA.'configs/'.$sAdditionalFileName; + $this->sAdditionalFile = \R_APP_PRIVATE_DATA.'configs/'.$sAdditionalFileName; $this->sAdditionalFile = 0 < \strlen($sAdditionalFileName) && \file_exists($this->sAdditionalFile) ? $this->sAdditionalFile : ''; diff --git a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Config/Application.php b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Config/Application.php index 374264a..f0c9aa4 100644 --- a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Config/Application.php +++ b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Config/Application.php @@ -103,7 +103,7 @@ class Application extends \RainLoop\Config\AbstractConfig { return $this->Set('security', 'admin_password', password_hash($sPassword, PASSWORD_DEFAULT)); } - return $this->Set('security', 'admin_password', \md5(APP_SALT.$sPassword.APP_SALT)); + return $this->Set('security', 'admin_password', \md5(R_APP_SALT.$sPassword.R_APP_SALT)); } /** @@ -124,7 +124,7 @@ class Application extends \RainLoop\Config\AbstractConfig } if (32 == strlen($sConfigPassword)) // legacy md5 hash { - return (\md5(APP_SALT.$sPassword.APP_SALT) === $sConfigPassword); + return (\md5(R_APP_SALT.$sPassword.R_APP_SALT) === $sConfigPassword); } if (function_exists('password_verify')) // secure hash { @@ -139,7 +139,7 @@ class Application extends \RainLoop\Config\AbstractConfig */ public function Save() { - $this->Set('version', 'current', APP_VERSION); + $this->Set('version', 'current', R_APP_VERSION); $this->Set('version', 'saved', \gmdate('r')); return parent::Save(); diff --git a/app/rainloop/v/1.16.0/app/libraries/RainLoop/KeyPathHelper.php b/app/rainloop/v/1.16.0/app/libraries/RainLoop/KeyPathHelper.php index cae3154..9a53f5b 100644 --- a/app/rainloop/v/1.16.0/app/libraries/RainLoop/KeyPathHelper.php +++ b/app/rainloop/v/1.16.0/app/libraries/RainLoop/KeyPathHelper.php @@ -96,7 +96,7 @@ class KeyPathHelper */ static public function LangCache($sLanguage, $bAdmim, $sPluginsHash) { - return '/LangCache/'.$sPluginsHash.'/'.$sLanguage.'/'.($bAdmim ? 'Admin' : 'App').'/'.APP_VERSION.'/'; + return '/LangCache/'.$sPluginsHash.'/'.$sLanguage.'/'.($bAdmim ? 'Admin' : 'App').'/'.R_APP_VERSION.'/'; } /** @@ -107,7 +107,7 @@ class KeyPathHelper */ static public function TemplatesCache($bAdmin, $sPluginsHash) { - return '/TemplatesCache/'.$sPluginsHash.'/'.($bAdmin ? 'Admin' : 'App').'/'.APP_VERSION.'/'; + return '/TemplatesCache/'.$sPluginsHash.'/'.($bAdmin ? 'Admin' : 'App').'/'.R_APP_VERSION.'/'; } /** @@ -117,7 +117,7 @@ class KeyPathHelper */ static public function PluginsJsCache($sPluginsHash) { - return '/PluginsJsCache/'.$sPluginsHash.'/'.APP_VERSION.'/'; + return '/PluginsJsCache/'.$sPluginsHash.'/'.R_APP_VERSION.'/'; } /** @@ -129,7 +129,7 @@ class KeyPathHelper */ static public function CssCache($sTheme, $sHash) { - return '/CssCache/'.$sHash.'/'.$sTheme.'/'.APP_VERSION.'/'; + return '/CssCache/'.$sHash.'/'.$sTheme.'/'.R_APP_VERSION.'/'; } /** diff --git a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Model/Account.php b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Model/Account.php index b0e446c..23d4af8 100644 --- a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Model/Account.php +++ b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Model/Account.php @@ -257,8 +257,8 @@ class Account extends \RainLoop\Account // for backward compatibility */ public function Hash() { - return md5(APP_SALT.$this->Email().APP_SALT.$this->DomainIncHost(). - APP_SALT.$this->DomainIncPort().APP_SALT.$this->Password().APP_SALT.'0'.APP_SALT.$this->ParentEmail().APP_SALT); + return md5(R_APP_SALT.$this->Email().R_APP_SALT.$this->DomainIncHost(). + R_APP_SALT.$this->DomainIncPort().R_APP_SALT.$this->Password().R_APP_SALT.'0'.R_APP_SALT.$this->ParentEmail().R_APP_SALT); } /** diff --git a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Plugins/Manager.php b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Plugins/Manager.php index 00d7517..aa7d3dc 100644 --- a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Plugins/Manager.php +++ b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Plugins/Manager.php @@ -121,13 +121,13 @@ class Manager { $oPlugin = null; if (\preg_match('/^[a-z0-9\-]+$/', $sName) && - \file_exists(APP_PLUGINS_PATH.$sName.'/index.php')) + \file_exists(R_APP_PLUGINS_PATH.$sName.'/index.php')) { $sClassName = $this->convertPluginFolderNameToClassName($sName); if (!\class_exists($sClassName)) { - include APP_PLUGINS_PATH.$sName.'/index.php'; + include R_APP_PLUGINS_PATH.$sName.'/index.php'; } if (\class_exists($sClassName)) @@ -137,9 +137,9 @@ class Manager { $oPlugin ->SetName($sName) - ->SetPath(APP_PLUGINS_PATH.$sName) - ->SetVersion(\file_exists(APP_PLUGINS_PATH.$sName.'/VERSION') ? - \file_get_contents(APP_PLUGINS_PATH.$sName.'/VERSION') : '') + ->SetPath(R_APP_PLUGINS_PATH.$sName) + ->SetVersion(\file_exists(R_APP_PLUGINS_PATH.$sName.'/VERSION') ? + \file_get_contents(R_APP_PLUGINS_PATH.$sName.'/VERSION') : '') ->SetPluginManager($this) ->SetPluginConfig(new \RainLoop\Config\Plugin($sName, $oPlugin->ConfigMap())) ; @@ -161,7 +161,7 @@ class Manager { $aList = array(); - $aGlob = @\glob(APP_PLUGINS_PATH.'*', GLOB_ONLYDIR|GLOB_NOSORT); + $aGlob = @\glob(R_APP_PLUGINS_PATH.'*', GLOB_ONLYDIR|GLOB_NOSORT); if (\is_array($aGlob)) { foreach ($aGlob as $sPathName) @@ -180,7 +180,7 @@ class Manager } else { - $this->Actions()->Logger()->Write('Cannot get installed plugins from '.APP_PLUGINS_PATH, + $this->Actions()->Logger()->Write('Cannot get installed plugins from '.R_APP_PLUGINS_PATH, \MailSo\Log\Enumerations\Type::ERROR); } @@ -213,7 +213,7 @@ class Manager */ public function Hash() { - $sResult = \md5(APP_VERSION); + $sResult = \md5(R_APP_VERSION); foreach ($this->aPlugins as $oPlugin) { $sResult = \md5($sResult.$oPlugin->Path().$oPlugin->Hash()); diff --git a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Providers/AddressBook/Classes/Contact.php b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Providers/AddressBook/Classes/Contact.php index 41085ff..91ce266 100644 --- a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Providers/AddressBook/Classes/Contact.php +++ b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Providers/AddressBook/Classes/Contact.php @@ -240,7 +240,7 @@ class Contact } $oVCard->VERSION = '3.0'; - $oVCard->PRODID = '-//RainLoop//'.APP_VERSION.'//EN'; + $oVCard->PRODID = '-//RainLoop//'.R_APP_VERSION.'//EN'; unset($oVCard->FN, $oVCard->EMAIL, $oVCard->TEL, $oVCard->URL, $oVCard->NICKNAME); diff --git a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Providers/Domain/DefaultDomain.php b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Providers/Domain/DefaultDomain.php index cce5726..d752b88 100644 --- a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Providers/Domain/DefaultDomain.php +++ b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Providers/Domain/DefaultDomain.php @@ -60,7 +60,7 @@ class DefaultDomain implements \RainLoop\Providers\Domain\DomainAdminInterface */ private function wildcardDomainsCacheKey() { - return '/WildCard/DomainCache/'.\md5(APP_VERSION.APP_PRIVATE_DATA_NAME).'/'; + return '/WildCard/DomainCache/'.\md5(R_APP_VERSION.APP_PRIVATE_DATA_NAME).'/'; } /** diff --git a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Providers/TwoFactorAuth/GoogleTwoFactorAuth.php b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Providers/TwoFactorAuth/GoogleTwoFactorAuth.php index 0835d90..324a38b 100644 --- a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Providers/TwoFactorAuth/GoogleTwoFactorAuth.php +++ b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Providers/TwoFactorAuth/GoogleTwoFactorAuth.php @@ -14,7 +14,7 @@ class GoogleTwoFactorAuth */ public function VerifyCode($sSecret, $sCode) { - include_once APP_VERSION_ROOT_PATH.'app/libraries/PHPGangsta/GoogleAuthenticator.php'; + include_once R_APP_VERSION_ROOT_PATH.'app/libraries/PHPGangsta/GoogleAuthenticator.php'; $oGoogleAuthenticator = new \PHPGangsta_GoogleAuthenticator(); return $oGoogleAuthenticator->verifyCode($sSecret, $sCode, 8); @@ -25,7 +25,7 @@ class GoogleTwoFactorAuth */ public function CreateSecret() { - include_once APP_VERSION_ROOT_PATH.'app/libraries/PHPGangsta/GoogleAuthenticator.php'; + include_once R_APP_VERSION_ROOT_PATH.'app/libraries/PHPGangsta/GoogleAuthenticator.php'; $oGoogleAuthenticator = new \PHPGangsta_GoogleAuthenticator(); return $oGoogleAuthenticator->createSecret(); diff --git a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Service.php b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Service.php index e23a9b2..47e60b2 100644 --- a/app/rainloop/v/1.16.0/app/libraries/RainLoop/Service.php +++ b/app/rainloop/v/1.16.0/app/libraries/RainLoop/Service.php @@ -193,11 +193,11 @@ class Service @header('Content-Type: text/html; charset=utf-8'); $this->oHttp->ServerNoCache(); - if (!@\is_dir(APP_DATA_FOLDER_PATH) || !@\is_writable(APP_DATA_FOLDER_PATH)) + if (!@\is_dir(R_APP_DATA_FOLDER_PATH) || !@\is_writable(R_APP_DATA_FOLDER_PATH)) { echo $this->oServiceActions->ErrorTemplates( 'Permission denied!', - 'RainLoop Webmail cannot access to the data folder "'.APP_DATA_FOLDER_PATH.'"' + 'RainLoop Webmail cannot access to the data folder "'.R_APP_DATA_FOLDER_PATH.'"' ); return $this; @@ -215,7 +215,7 @@ class Service if (0 === \strlen($sResult)) { $aTemplateParameters['{{BaseTemplates}}'] = $this->oServiceActions->compileTemplates($bAdmin, false); - $sResult = \strtr(\file_get_contents(APP_VERSION_ROOT_PATH.'app/templates/Index.html'), $aTemplateParameters); + $sResult = \strtr(\file_get_contents(R_APP_VERSION_ROOT_PATH.'app/templates/Index.html'), $aTemplateParameters); $sResult = \RainLoop\Utils::ClearHtmlOutput($sResult); if (0 < \strlen($sCacheFileName)) @@ -231,7 +231,7 @@ class Service $sResult .= '