summaryrefslogtreecommitdiffstats
path: root/settings/ajax
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2013-08-06 17:19:18 +0200
committerkondou <kondou@ts.unde.re>2013-08-06 17:19:18 +0200
commit1a4465f41d3fe334f42782545e3130a19796e590 (patch)
treeb3e5fbd743dd22ea3255e96593735791a59b11a1 /settings/ajax
parent057d7aa108f9b24c12b97f5f78008eb17a6d3bee (diff)
downloadnextcloud-server-1a4465f41d3fe334f42782545e3130a19796e590.tar.gz
nextcloud-server-1a4465f41d3fe334f42782545e3130a19796e590.zip
Improve app-management
- Better error messages - Translate untranslated strings Basically picks non-app-dependency related stuff from #4017
Diffstat (limited to 'settings/ajax')
-rw-r--r--settings/ajax/enableapp.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/settings/ajax/enableapp.php b/settings/ajax/enableapp.php
index ab84aee5166..0784736a655 100644
--- a/settings/ajax/enableapp.php
+++ b/settings/ajax/enableapp.php
@@ -3,10 +3,9 @@
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
-$appid = OC_App::enable(OC_App::cleanAppId($_POST['appid']));
-if($appid !== false) {
- OC_JSON::success(array('data' => array('appid' => $appid)));
-} else {
- $l = OC_L10N::get('settings');
- OC_JSON::error(array("data" => array( "message" => $l->t("Could not enable app. ") )));
+try {
+ OC_App::enable(OC_App::cleanAppId($_POST['appid']));
+ OC_JSON::success();
+} catch (Exception $e) {
+ OC_JSON::error(array("data" => array("message" => $e->getMessage()) ));
}