diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-10-27 17:41:15 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-10-31 17:17:44 +0100 |
commit | 32cf661215fb3926789054a3953b465fc2665330 (patch) | |
tree | 4cf2865bef5856c59a1fdacb98208a14dfc1a128 /settings/ajax | |
parent | 357a823457397d3e93ec8cd4dc01fb6859eb0049 (diff) | |
download | nextcloud-server-32cf661215fb3926789054a3953b465fc2665330.tar.gz nextcloud-server-32cf661215fb3926789054a3953b465fc2665330.zip |
Use new appstore API
This change introduces the new appstore API in Nextcloud.
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'settings/ajax')
-rw-r--r-- | settings/ajax/enableapp.php | 6 | ||||
-rw-r--r-- | settings/ajax/installapp.php | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/settings/ajax/enableapp.php b/settings/ajax/enableapp.php index db4503f20e7..b378b3c918d 100644 --- a/settings/ajax/enableapp.php +++ b/settings/ajax/enableapp.php @@ -31,8 +31,10 @@ OCP\JSON::callCheck(); $groups = isset($_POST['groups']) ? (array)$_POST['groups'] : null; try { - $app = OC_App::cleanAppId((string)$_POST['appid']); - OC_App::enable($app, $groups); + $app = new OC_App(); + $appId = (string)$_POST['appid']; + $appId = OC_App::cleanAppId($appId); + $app->enable($appId, $groups); OC_JSON::success(['data' => ['update_required' => \OC_App::shouldUpgrade($app)]]); } catch (Exception $e) { \OCP\Util::writeLog('core', $e->getMessage(), \OCP\Util::ERROR); diff --git a/settings/ajax/installapp.php b/settings/ajax/installapp.php index 8831305e223..75f3fea83b7 100644 --- a/settings/ajax/installapp.php +++ b/settings/ajax/installapp.php @@ -29,14 +29,15 @@ if (!array_key_exists('appid', $_POST)) { exit; } +$app = new OC_App(); $appId = (string)$_POST['appid']; $appId = OC_App::cleanAppId($appId); - -$result = OC_App::installApp($appId); +$result = $app->installApp( + $appId, + \OC::$server->getConfig(), + \OC::$server->getL10N('core') +); if($result !== false) { - // FIXME: Clear the cache - move that into some sane helper method - \OC::$server->getMemCacheFactory()->create('settings')->remove('listApps-0'); - \OC::$server->getMemCacheFactory()->create('settings')->remove('listApps-1'); OC_JSON::success(array('data' => array('appid' => $appId))); } else { $l = \OC::$server->getL10N('settings'); |