diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/api.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/api.php b/include/api.php index c0f54af19..47de945db 100644 --- a/include/api.php +++ b/include/api.php @@ -582,10 +582,43 @@ require_once('include/items.php'); api_register_func('api/red/photos','api_photos', true); + function api_group_members(&$a,$type) { + if(api_user() === false) + return false; + + if($_REQUEST['group_id']) { + $r = q("select * from groups where uid = %d and id = %d limit 1", + intval(api_user()), + intval($_REQUEST['group_id']) + ); + if($r) { + $x = q("select * from group_member left join xchan on group_member.xchan = xchan.xchan_hash + left join abook on abook_xchan = xchan_hash where gid = %d", + intval($_REQUEST['group_id']) + ); + json_return_and_die($x); + } + } + } + + api_register_func('api/red/group_members','api_group_members', true); + function api_group(&$a,$type) { + if(api_user() === false) + return false; + + $r = q("select * from groups where uid = %d", + intval(api_user()) + ); + json_return_and_die($r); + } + api_register_func('api/red/group','api_group', true); + + + function api_statuses_mediap(&$a, $type) { if (api_user() === false) { |