diff options
-rw-r--r-- | include/api_zot.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/api_zot.php b/include/api_zot.php index 2390bb4c2..b4b4a1742 100644 --- a/include/api_zot.php +++ b/include/api_zot.php @@ -33,6 +33,8 @@ api_register_func('api/red/item/full','red_item', true); api_register_func('api/z/1.0/item/full','red_item', true); + api_register_func('api/z/1.0/abook','api_zot_abook_xchan',true); + return; } @@ -268,6 +270,23 @@ json_return_and_die($r); }; + function api_zot_abook_xchan($type) { + logger('api_abook_xchan'); + + if(api_user() === false) + return false; + + $sql_extra = ((array_key_exists('abook_id',$_REQUEST) && intval($_REQUEST['abook_id'])) ? ' and abook_id = ' . intval($_REQUEST['abook_id']) . ' ' : ''); + if($_SERVER['REQUEST_METHOD'] === 'POST') { + // update + } + $r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d $sql_extra ", + intval(api_user()) + ); + + json_return_and_die($r); + }; + function red_item_new($type) { |