diff options
author | zotlabs <mike@macgirvin.com> | 2016-11-14 20:30:28 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-11-14 20:30:28 -0800 |
commit | b9728a96ce22f90e40ff5d5c3a4f5bf413dcbde6 (patch) | |
tree | cd626ac22464866a48594f2e48d6f4c05cb18b5d | |
parent | 537510f0810976c2b8cd3861d914645a4e2c2b06 (diff) | |
download | volse-hubzilla-b9728a96ce22f90e40ff5d5c3a4f5bf413dcbde6.tar.gz volse-hubzilla-b9728a96ce22f90e40ff5d5c3a4f5bf413dcbde6.tar.bz2 volse-hubzilla-b9728a96ce22f90e40ff5d5c3a4f5bf413dcbde6.zip |
API: add GET /api/z/1.0/abconfig
-rw-r--r-- | include/api_zot.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/api_zot.php b/include/api_zot.php index b4b4a1742..107b73796 100644 --- a/include/api_zot.php +++ b/include/api_zot.php @@ -34,6 +34,7 @@ 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); + api_register_func('api/z/1.0/abconfig','api_zot_abconfig',true); return; } @@ -287,6 +288,22 @@ json_return_and_die($r); }; + function api_zot_abconfig($type) { + + 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 abconfig.* from abconfig left join abook on abook_xchan = abconfig.xchan and abook_channel = abconfig.chan where abconfig.chan = %d $sql_extra ", + intval(api_user()) + ); + + json_return_and_die($r); + + } function red_item_new($type) { |