init_groups_visitor() was still using old array of id output (not the newer array of hash which we need for permission queries)

This commit is contained in:
friendica
2013-11-22 11:52:38 -08:00
parent f6b43a0a7b
commit 34f8b21511
4 changed files with 402 additions and 403 deletions

View File

@@ -386,12 +386,12 @@ function check_form_security_token_ForbiddenOnErr($typename = '', $formname = 'f
if(! function_exists('init_groups_visitor')) {
function init_groups_visitor($contact_id) {
$groups = array();
$r = q("SELECT gid FROM group_member WHERE xchan = '%s' ",
$r = q("SELECT hash FROM `group` left join group_member on group.id = group_member.gid WHERE xchan = '%s' ",
dbesc($contact_id)
);
if(count($r)) {
foreach($r as $rr)
$groups[] = $rr['gid'];
$groups[] = $rr['hash'];
}
return $groups;
}}