summaryrefslogtreecommitdiffstats
path: root/settings/ajax/installapp.php
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2014-06-16 15:54:50 +0200
committerGeorg Ehrke <developer@georgehrke.com>2014-06-16 15:54:50 +0200
commit15c215cd031602013d982d630306314fc6c1b21c (patch)
treee7f5bea6cc6d43694cd61dfedaef4ce7723e3b52 /settings/ajax/installapp.php
parentb67588d35c2ebf031e4f4f46fbce73fd555d33e8 (diff)
parent86f546ff6487b9ac8b18ad14ca290b8051f0496e (diff)
downloadnextcloud-server-15c215cd031602013d982d630306314fc6c1b21c.tar.gz
nextcloud-server-15c215cd031602013d982d630306314fc6c1b21c.zip
Merge pull request #8808 from owncloud/update_shipped_apps_from_appstore
Make shipped apps updatable via appstore
Diffstat (limited to 'settings/ajax/installapp.php')
-rw-r--r--settings/ajax/installapp.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/settings/ajax/installapp.php b/settings/ajax/installapp.php
new file mode 100644
index 00000000000..47f40f2b0cd
--- /dev/null
+++ b/settings/ajax/installapp.php
@@ -0,0 +1,19 @@
+<?php
+OCP\JSON::checkAdminUser();
+OCP\JSON::callCheck();
+
+if (!array_key_exists('appid', $_POST)) {
+ OC_JSON::error();
+ exit;
+}
+
+$appId = $_POST['appid'];
+$appId = OC_App::cleanAppId($appId);
+
+$result = OC_App::installApp($appId);
+if($result !== false) {
+ OC_JSON::success(array('data' => array('appid' => $appId)));
+} else {
+ $l = OC_L10N::get('settings');
+ OC_JSON::error(array("data" => array( "message" => $l->t("Couldn't remove app.") )));
+}