aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-09-15 22:54:19 +0200
committerGitHub <noreply@github.com>2024-09-15 22:54:19 +0200
commit6a46dad143d974ee083b0e496efe381b6238d09f (patch)
treee61ec74e6e5e6763bdf862e17be2712e3f88eaca /lib
parent8cf7ab105e9cb59e6bc8ae28125fd5bad116bcc4 (diff)
parented80a9ffa933a8cd0e21b904da2d20d2f806a6d2 (diff)
downloadnextcloud-server-6a46dad143d974ee083b0e496efe381b6238d09f.tar.gz
nextcloud-server-6a46dad143d974ee083b0e496efe381b6238d09f.zip
Merge pull request #47871 from nextcloud/backport/47834/stable29
[stable29] fix(appstore): return if appstore is manually disabled
Diffstat (limited to 'lib')
-rw-r--r--lib/private/App/AppStore/Fetcher/AppFetcher.php11
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..511b9393e18 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->info('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']);