summaryrefslogtreecommitdiffstats
path: root/settings/ajax/enableapp.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-04-23 22:10:17 +0200
committerLukas Reschke <lukas@statuscode.ch>2017-04-26 20:07:49 +0200
commit47cd9760350baaf24bdf92c7a77129e59ec2f8f3 (patch)
treec7e81c5440588267a6a275dbd661b07b3363dea8 /settings/ajax/enableapp.php
parent646db7f88d911459bdfa038d8a66ded27ae888a4 (diff)
downloadnextcloud-server-47cd9760350baaf24bdf92c7a77129e59ec2f8f3.tar.gz
nextcloud-server-47cd9760350baaf24bdf92c7a77129e59ec2f8f3.zip
Add app bundles
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'settings/ajax/enableapp.php')
-rw-r--r--settings/ajax/enableapp.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/settings/ajax/enableapp.php b/settings/ajax/enableapp.php
index b6d62671a63..4c4fa0be666 100644
--- a/settings/ajax/enableapp.php
+++ b/settings/ajax/enableapp.php
@@ -36,13 +36,20 @@ if ($lastConfirm < (time() - 30 * 60 + 15)) { // allow 15 seconds delay
}
$groups = isset($_POST['groups']) ? (array)$_POST['groups'] : null;
+$appIds = isset($_POST['appIds']) ? (array)$_POST['appIds'] : [];
try {
- $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($appId)]]);
+ $updateRequired = false;
+ foreach($appIds as $appId) {
+ $app = new OC_App();
+ $appId = OC_App::cleanAppId($appId);
+ $app->enable($appId, $groups);
+ if(\OC_App::shouldUpgrade($appId)) {
+ $updateRequired = true;
+ }
+ }
+
+ OC_JSON::success(['data' => ['update_required' => $updateRequired]]);
} catch (Exception $e) {
\OCP\Util::writeLog('core', $e->getMessage(), \OCP\Util::ERROR);
OC_JSON::error(array("data" => array("message" => $e->getMessage()) ));