summaryrefslogtreecommitdiffstats
path: root/settings/Controller
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-03-06 19:59:15 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-03-20 15:16:11 +0100
commit769cb629aebd368fbddd6ea04067fdcfaa262e3e (patch)
tree432bfb3aca1d60128e79da57c2053bf7f19291a2 /settings/Controller
parent1c8779dc6e34a89ea9181b3cb252101e457c1543 (diff)
downloadnextcloud-server-769cb629aebd368fbddd6ea04067fdcfaa262e3e.tar.gz
nextcloud-server-769cb629aebd368fbddd6ea04067fdcfaa262e3e.zip
allow enforcing apps to ignore the max version
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'settings/Controller')
-rw-r--r--settings/Controller/AppSettingsController.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/settings/Controller/AppSettingsController.php b/settings/Controller/AppSettingsController.php
index 2842ead3eaa..788221f92a0 100644
--- a/settings/Controller/AppSettingsController.php
+++ b/settings/Controller/AppSettingsController.php
@@ -274,13 +274,17 @@ class AppSettingsController extends Controller {
$appData['licence'] = $appData['license'];
}
+ $ignoreMaxApps = $this->config->getSystemValue('app_install_overwrite', []);
+ $ignoreMax = in_array($appData['id'], $ignoreMaxApps);
+
// analyse dependencies
- $missing = $dependencyAnalyzer->analyze($appData);
+ $missing = $dependencyAnalyzer->analyze($appData, $ignoreMax);
$appData['canInstall'] = empty($missing);
$appData['missingDependencies'] = $missing;
$appData['missingMinOwnCloudVersion'] = !isset($appData['dependencies']['nextcloud']['@attributes']['min-version']);
$appData['missingMaxOwnCloudVersion'] = !isset($appData['dependencies']['nextcloud']['@attributes']['max-version']);
+ $appData['isCompatible'] = $dependencyAnalyzer->isMarkedCompatible($appData);
return $appData;
}, $apps);
@@ -315,6 +319,9 @@ class AppSettingsController extends Controller {
}
}
+ if (!isset($app['releases'][0]['rawPlatformVersionSpec'])) {
+ continue;
+ }
$nextCloudVersion = $versionParser->getVersion($app['releases'][0]['rawPlatformVersionSpec']);
$nextCloudVersionDependencies = [];
if($nextCloudVersion->getMinimumVersion() !== '') {
@@ -544,4 +551,16 @@ class AppSettingsController extends Controller {
return ($a < $b) ? -1 : 1;
}
+ public function force(string $appId): JSONResponse {
+ $appId = OC_App::cleanAppId($appId);
+
+ $ignoreMaxApps = $this->config->getSystemValue('app_install_overwrite', []);
+ if (!in_array($appId, $ignoreMaxApps, true)) {
+ $ignoreMaxApps[] = $appId;
+ $this->config->setSystemValue('app_install_overwrite', $ignoreMaxApps);
+ }
+
+ return new JSONResponse();
+ }
+
}