summaryrefslogtreecommitdiffstats
path: root/application/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'application/controllers')
-rw-r--r--application/controllers/user.php5
1 files changed, 5 insertions, 0 deletions
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 {