diff options
author | kondou <kondou@ts.unde.re> | 2013-08-06 17:19:18 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-08-06 17:19:18 +0200 |
commit | 1a4465f41d3fe334f42782545e3130a19796e590 (patch) | |
tree | b3e5fbd743dd22ea3255e96593735791a59b11a1 /settings/ajax | |
parent | 057d7aa108f9b24c12b97f5f78008eb17a6d3bee (diff) | |
download | nextcloud-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.php | 11 |
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()) )); } |