diff options
author | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-09-09 09:29:09 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-09-10 14:33:22 +0000 |
commit | 35e473019e2dd6b43c846960a9b34e0c10fc207d (patch) | |
tree | 0ef6b442913448a46a1350c949f24c530086f137 /lib | |
parent | b359a650e5e0507685702b6d56c2e8debb0abda6 (diff) | |
download | nextcloud-server-35e473019e2dd6b43c846960a9b34e0c10fc207d.tar.gz nextcloud-server-35e473019e2dd6b43c846960a9b34e0c10fc207d.zip |
fix(appstore): return if appstore is manually disabled
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
fix: camel case
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
fix: log a debug log
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
fix: typing
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
fix: typo
fix: typing
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/App/AppStore/Fetcher/AppFetcher.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index 173c0d68437..3fd24c80fe7 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -172,10 +172,17 @@ class AppFetcher extends Fetcher { $this->ignoreMaxVersion = $ignoreMaxVersion; } - - public function get($allowUnstable = false) { + public function get($allowUnstable = false): array { $allowPreReleases = $allowUnstable || $this->getChannel() === 'beta' || $this->getChannel() === 'daily' || $this->getChannel() === 'git'; + $appStoreEnabled = $this->config->getSystemValueBool('appstoreenabled', true); + $internetAvailable = $this->config->getSystemValueBool('has_internet_connection', true); + + if (!$appStoreEnabled || !$internetAvailable) { + $this->logger->debug('AppStore is disabled or this instance has no Internet connection', ['app' => 'appstoreFetcher']); + return []; + } + $apps = parent::get($allowPreReleases); if (empty($apps)) { $this->logger->warning('Could not get apps from the appstore', ['app' => 'appstoreFetcher']); |