summaryrefslogtreecommitdiffstats
path: root/lib/private/App
diff options
context:
space:
mode:
authorSteffen Lindner <mail@steffen-lindner.de>2017-01-26 19:02:45 +0100
committerJoas Schilling <coding@schilljs.com>2017-02-24 08:31:56 +0100
commitcfb6223de72a242e63d6ccf8b811f25958240dd0 (patch)
treed824b76332ef8c83f991889a23f035ffa3f78504 /lib/private/App
parent97b6c1496e76042e3582941aa7411e455fe9d3b8 (diff)
downloadnextcloud-server-cfb6223de72a242e63d6ccf8b811f25958240dd0.tar.gz
nextcloud-server-cfb6223de72a242e63d6ccf8b811f25958240dd0.zip
Add back appstoreenabled config switch
Signed-off-by: Steffen Lindner <mail@steffen-lindner.de>
Diffstat (limited to 'lib/private/App')
-rw-r--r--lib/private/App/AppStore/Fetcher/Fetcher.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php
index dab79e11821..7f38e72be2d 100644
--- a/lib/private/App/AppStore/Fetcher/Fetcher.php
+++ b/lib/private/App/AppStore/Fetcher/Fetcher.php
@@ -69,6 +69,14 @@ abstract class Fetcher {
* @return array
*/
protected function fetch($ETag, $content) {
+
+ $systemConfig = \OC::$server->getSystemConfig();
+ $appstoreenabled = $systemConfig->getValue('appstoreenabled', true);
+
+ if (!$appstoreenabled) {
+ return [];
+ }
+
$options = [];
if ($ETag !== '') {
@@ -102,7 +110,14 @@ abstract class Fetcher {
*
* @return array
*/
- public function get() {
+ public function get() {
+ $systemConfig = \OC::$server->getSystemConfig();
+ $appstoreenabled = $systemConfig->getValue('appstoreenabled', true);
+
+ if (!$appstoreenabled) {
+ return [];
+ }
+
$rootFolder = $this->appData->getFolder('/');
$ETag = '';
@@ -112,13 +127,14 @@ abstract class Fetcher {
// File does already exists
$file = $rootFolder->getFile($this->fileName);
$jsonBlob = json_decode($file->getContent(), true);
- if(is_array($jsonBlob)) {
+ if (is_array($jsonBlob)) {
/*
* If the timestamp is older than 300 seconds request the files new
* If the version changed (update!) also refresh
*/
- if((int)$jsonBlob['timestamp'] > ($this->timeFactory->getTime() - self::INVALIDATE_AFTER_SECONDS) &&
- isset($jsonBlob['ncversion']) && $jsonBlob['ncversion'] === $this->config->getSystemValue('version', '0.0.0')) {
+ if ((int)$jsonBlob['timestamp'] > ($this->timeFactory->getTime() - self::INVALIDATE_AFTER_SECONDS) &&
+ isset($jsonBlob['ncversion']) && $jsonBlob['ncversion'] === $this->config->getSystemValue('version', '0.0.0')
+ ) {
return $jsonBlob['data'];
}