From d3f3f69e6aa20254eb68118f83663579558ca2ab Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 8 Sep 2013 20:55:26 +0200 Subject: user/create_apikey: Add JSON support Signed-off-by: Florian Pritz --- application/controllers/user.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'application/controllers/user.php') diff --git a/application/controllers/user.php b/application/controllers/user.php index 38b18c9a0..823166ea5 100644 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -9,6 +9,7 @@ class User extends MY_Controller { protected $json_enabled_functions = array( + "create_apikey", "apikeys", ); @@ -94,6 +95,10 @@ class User extends MY_Controller { VALUES (?, ?, ?) ", array($key, $userid, $comment)); + if (static_storage("response_type") == "json") { + return send_json_reply(array("new_key" => $key)); + } + if (is_cli_client()) { echo "$key\n"; } else { -- cgit v1.2.3-24-g4f1b