From 84ce2c6ce0eb1b4f2f32c4ae0d7e08f3571f5018 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 14 Aug 2013 17:06:07 +0200 Subject: Provide json output for api functions Signed-off-by: Florian Pritz --- application/controllers/user.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'application/controllers/user.php') diff --git a/application/controllers/user.php b/application/controllers/user.php index 498a626d7..56f571d6a 100644 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -8,6 +8,10 @@ */ class User extends MY_Controller { + protected $json_enabled_functions = array( + "apikeys", + ); + function __construct() { @@ -127,6 +131,10 @@ class User extends MY_Controller { WHERE `user` = ? order by created desc ", array($userid))->result_array(); + if (request_type() == "json") { + return send_json_reply($query); + } + $this->data["query"] = $query; $this->load->view('header', $this->data); -- cgit v1.2.3-24-g4f1b