From c28f82a3b9e2b727cc747caf361973b12be2ca38 Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Thu, 28 Nov 2013 01:09:41 +0400 Subject: [PATCH] Fix additional repository file name --- package.json | 2 +- .../0.0.0/app/libraries/RainLoop/Actions.php | 38 ++++++++++++------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 74c0349e0..bd69450d9 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "RainLoop", "title": "RainLoop Webmail", "version": "1.4.2", - "release": "524", + "release": "525", "description": "Simple, modern & fast web-based email client", "homepage": "http://rainloop.net", "main": "Gruntfile.js", diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php index f9e444a6a..e2309b03c 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -2224,26 +2224,35 @@ class Actions return '' === $sCoreAccess || APP_SITE === $sCoreAccess; } - private function getRepositoryDataByUrl($sRepo, &$bReal = false) + /** + * @param string $sRepo + * @param bool $bReal = false + * @param bool $bMain = true + * @return array + */ + private function getRepositoryDataByUrl($sRepo, &$bReal = false, $bMain = true) { $bReal = false; $aRep = null; $sRep = ''; - $sRepoType = \strtolower(\trim($this->Config()->Get('labs', 'repo_type', 'stable'))); $sRepoFile = 'repository.json'; $iRepTime = 0; - switch ($sRepoType) { - case 'dev': - case 'nightly': - case 'beta': - $sRepoFile = 'beta.repository.json'; - break; - case 'stable': - default: - $sRepoFile = 'repository.json'; - break; + if ($bMain) + { + switch (\strtolower(\trim($this->Config()->Get('labs', 'repo_type', 'stable')))) + { + case 'dev': + case 'nightly': + case 'beta': + $sRepoFile = 'beta.repository.json'; + break; + case 'stable': + default: + $sRepoFile = 'repository.json'; + break; + } } $oHttp = \MailSo\Base\Http::SingletonInstance(); @@ -2352,8 +2361,9 @@ class Actions $sAddRepo = $this->rainloopRepo(true); if (0 < \strlen($sAddRepo)) { - $aAddData = $this->getRepositoryDataByUrl($sAddRepo); - if (\is_array($aAddData) && 0 < \count($aAddData)) + $bFakeReal = false; + $aAddData = $this->getRepositoryDataByUrl($sAddRepo, $bFakeReal, false); + if ($bFakeReal && \is_array($aAddData) && 0 < \count($aAddData)) { $aResult = \array_merge($aResult, $aAddData); }