diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-10-31 11:07:54 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-10-31 17:17:47 +0100 |
commit | 8acb54aa0b32a8b750f8ab3aba9f63aa931be7d1 (patch) | |
tree | af744fe68adce931a8bb1b5918c93210b828124e /settings/ajax | |
parent | df7fd2b57cb211b3a6a9febdca4ab0a21baed19d (diff) | |
download | nextcloud-server-8acb54aa0b32a8b750f8ab3aba9f63aa931be7d1.tar.gz nextcloud-server-8acb54aa0b32a8b750f8ab3aba9f63aa931be7d1.zip |
Add update support
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'settings/ajax')
-rw-r--r-- | settings/ajax/updateapp.php | 19 |
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); |