From 87c171030c8de2e36f284fa6b58f11a5535a9a29 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 21 Oct 2012 17:23:21 -0700 Subject: upstream fixes --- include/security.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include/security.php') diff --git a/include/security.php b/include/security.php index d1b3deca7..50c2337bf 100644 --- a/include/security.php +++ b/include/security.php @@ -440,3 +440,24 @@ function check_form_security_token_ForbiddenOnErr($typename = '', $formname = 'f killme(); } } + +// Returns an array of group id's this contact is a member of. +// This array will only contain group id's related to the uid of this +// DFRN contact. They are *not* neccessarily unique across the entire site. + + +if(! function_exists('init_groups_visitor')) { +function init_groups_visitor($contact_id) { + $groups = array(); + $r = q("SELECT `gid` FROM `group_member` + WHERE `contact-id` = %d ", + intval($contact_id) + ); + if(count($r)) { + foreach($r as $rr) + $groups[] = $rr['gid']; + } + return $groups; +}} + + -- cgit v1.2.3