summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-06-19 19:01:58 +0200
committerLukas Reschke <lukas@owncloud.com>2015-06-19 19:04:54 +0200
commit00a65e30ce703e93e8e4c7a3658fe28271d2d623 (patch)
tree4ab0f5a3b2948133bf2ea2d91f17ddc2e14e5d53 /settings
parent5ed9743570173fbea59f150c2fe8da8d6c681cba (diff)
downloadnextcloud-server-00a65e30ce703e93e8e4c7a3658fe28271d2d623.tar.gz
nextcloud-server-00a65e30ce703e93e8e4c7a3658fe28271d2d623.zip
Request approved state for disabled apps with ocsid
In case an application gets disabled the level is set to "experimental" if it does not contain a `shipped` tag. This can for example be reproduced by installing the documents app from the appstore and then disabling it. Or cloning an app from git. With this change the controller will now load the level of the application from the appstore if a valid OCSID has been provided. Fixes https://github.com/owncloud/core/issues/17003
Diffstat (limited to 'settings')
-rw-r--r--settings/controller/appsettingscontroller.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/settings/controller/appsettingscontroller.php b/settings/controller/appsettingscontroller.php
index d64c945c02c..ef483cc3a03 100644
--- a/settings/controller/appsettingscontroller.php
+++ b/settings/controller/appsettingscontroller.php
@@ -176,6 +176,15 @@ class AppSettingsController extends Controller {
$apps = array_filter($apps, function ($app) {
return !$app['active'];
});
+ foreach($apps as $key => $app) {
+ if(!array_key_exists('level', $app) && array_key_exists('ocsid', $app)) {
+ $remoteAppEntry = $this->ocsClient->getApplication($app['ocsid']);
+
+ if(array_key_exists('level', $remoteAppEntry)) {
+ $apps[$key]['level'] = $remoteAppEntry['level'];
+ }
+ }
+ }
usort($apps, function ($a, $b) {
$a = (string)$a['name'];
$b = (string)$b['name'];