summaryrefslogtreecommitdiffstats
path: root/settings/ajax/updateapp.php
diff options
context:
space:
mode:
authorMichael Grosser <development@stp-ip.net>2016-11-02 17:00:24 +0000
committerGitHub <noreply@github.com>2016-11-02 17:00:24 +0000
commite81d04cd8d2ac0de3d06d4586550469384c5d91a (patch)
tree0e243d105db3e00f1d3f899b9ecfbd73f3d98235 /settings/ajax/updateapp.php
parent23dd62b653e42201468f9bed369a5993dea876b0 (diff)
parent0eeef26a8e2515b802015fe09bef7909aa183491 (diff)
downloadnextcloud-server-e81d04cd8d2ac0de3d06d4586550469384c5d91a.tar.gz
nextcloud-server-e81d04cd8d2ac0de3d06d4586550469384c5d91a.zip
Merge pull request #1940 from nextcloud/new-appstore
Use new appstore API
Diffstat (limited to 'settings/ajax/updateapp.php')
-rw-r--r--settings/ajax/updateapp.php19
1 files changed, 7 insertions, 12 deletions
diff --git a/settings/ajax/updateapp.php b/settings/ajax/updateapp.php
index 47ecac26cf1..3020f828577 100644
--- a/settings/ajax/updateapp.php
+++ b/settings/ajax/updateapp.php
@@ -35,23 +35,18 @@ if (!array_key_exists('appid', $_POST)) {
}
$appId = (string)$_POST['appid'];
-
-if (!is_numeric($appId)) {
- $appId = \OC::$server->getAppConfig()->getValue($appId, 'ocsid', null);
- if ($appId === null) {
- OCP\JSON::error(array(
- 'message' => 'No OCS-ID found for app!'
- ));
- exit;
- }
-}
-
$appId = OC_App::cleanAppId($appId);
$config = \OC::$server->getConfig();
$config->setSystemValue('maintenance', true);
try {
- $result = \OC\Installer::updateAppByOCSId($appId);
+ $installer = new \OC\Installer(
+ \OC::$server->getAppFetcher(),
+ \OC::$server->getHTTPClientService(),
+ \OC::$server->getTempManager(),
+ \OC::$server->getLogger()
+ );
+ $result = $installer->updateAppstoreApp($appId);
$config->setSystemValue('maintenance', false);
} catch(Exception $ex) {
$config->setSystemValue('maintenance', false);