Add back appstoreenabled config switch
Signed-off-by: Steffen Lindner <mail@steffen-lindner.de>
This commit is contained in:
parent
97b6c1496e
commit
cfb6223de7
1 changed files with 20 additions and 4 deletions
|
@ -69,6 +69,14 @@ abstract class Fetcher {
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function fetch($ETag, $content) {
|
protected function fetch($ETag, $content) {
|
||||||
|
|
||||||
|
$systemConfig = \OC::$server->getSystemConfig();
|
||||||
|
$appstoreenabled = $systemConfig->getValue('appstoreenabled', true);
|
||||||
|
|
||||||
|
if (!$appstoreenabled) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
$options = [];
|
$options = [];
|
||||||
|
|
||||||
if ($ETag !== '') {
|
if ($ETag !== '') {
|
||||||
|
@ -103,6 +111,13 @@ abstract class Fetcher {
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function get() {
|
public function get() {
|
||||||
|
$systemConfig = \OC::$server->getSystemConfig();
|
||||||
|
$appstoreenabled = $systemConfig->getValue('appstoreenabled', true);
|
||||||
|
|
||||||
|
if (!$appstoreenabled) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
$rootFolder = $this->appData->getFolder('/');
|
$rootFolder = $this->appData->getFolder('/');
|
||||||
|
|
||||||
$ETag = '';
|
$ETag = '';
|
||||||
|
@ -118,7 +133,8 @@ abstract class Fetcher {
|
||||||
* If the version changed (update!) also refresh
|
* If the version changed (update!) also refresh
|
||||||
*/
|
*/
|
||||||
if ((int)$jsonBlob['timestamp'] > ($this->timeFactory->getTime() - self::INVALIDATE_AFTER_SECONDS) &&
|
if ((int)$jsonBlob['timestamp'] > ($this->timeFactory->getTime() - self::INVALIDATE_AFTER_SECONDS) &&
|
||||||
isset($jsonBlob['ncversion']) && $jsonBlob['ncversion'] === $this->config->getSystemValue('version', '0.0.0')) {
|
isset($jsonBlob['ncversion']) && $jsonBlob['ncversion'] === $this->config->getSystemValue('version', '0.0.0')
|
||||||
|
) {
|
||||||
return $jsonBlob['data'];
|
return $jsonBlob['data'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue