diff options
author | zotlabs <mike@macgirvin.com> | 2016-11-14 17:47:44 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-11-14 17:47:44 -0800 |
commit | 9055d0910c5db17b0ecbf6c8d8cc6b8fef6b77a9 (patch) | |
tree | 10a9aa4ec2dfa36b5ea146f3851cda56a3ce9f5a /include/api_zot.php | |
parent | 078db2dd80ea143ecac349c68625fda49e910a63 (diff) | |
download | volse-hubzilla-9055d0910c5db17b0ecbf6c8d8cc6b8fef6b77a9.tar.gz volse-hubzilla-9055d0910c5db17b0ecbf6c8d8cc6b8fef6b77a9.tar.bz2 volse-hubzilla-9055d0910c5db17b0ecbf6c8d8cc6b8fef6b77a9.zip |
API: add GET api/z/1.0/abook
Diffstat (limited to 'include/api_zot.php')
-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) { |