testing init_groups_visitor changes - also add virtual groups for both zot identities
This commit is contained in:
parent
1688e373bc
commit
4e97fb0e58
@ -564,17 +564,6 @@ function check_form_security_token_ForbiddenOnErr($typename = '', $formname = 'f
|
|||||||
function init_groups_visitor($contact_id) {
|
function init_groups_visitor($contact_id) {
|
||||||
$groups = [];
|
$groups = [];
|
||||||
|
|
||||||
// private profiles are treated as a virtual group
|
|
||||||
|
|
||||||
$r = q("SELECT abook_profile from abook where abook_xchan = '%s' and abook_profile != '' ",
|
|
||||||
dbesc($contact_id)
|
|
||||||
);
|
|
||||||
if($r) {
|
|
||||||
foreach($r as $rv) {
|
|
||||||
$groups[] = 'vp.' . $rv['abook_profile'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$x = q("select * from xchan where xchan_hash = '%s'",
|
$x = q("select * from xchan where xchan_hash = '%s'",
|
||||||
dbesc($contact_id)
|
dbesc($contact_id)
|
||||||
);
|
);
|
||||||
@ -595,9 +584,18 @@ function init_groups_visitor($contact_id) {
|
|||||||
$hashes = ids_to_querystr($xchans,'xchan_hash',true);
|
$hashes = ids_to_querystr($xchans,'xchan_hash',true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// private profiles are treated as a virtual group
|
||||||
|
|
||||||
|
$r = q("SELECT abook_profile from abook where abook_xchan in ( " . protect_sprintf($hashes) . " ) and abook_profile != '' ");
|
||||||
|
if($r) {
|
||||||
|
foreach($r as $rv) {
|
||||||
|
$groups[] = 'vp.' . $rv['abook_profile'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// physical groups this identity is a member of
|
// physical groups this identity is a member of
|
||||||
|
|
||||||
$r = q("SELECT hash FROM pgrp left join pgrp_member on pgrp.id = pgrp_member.gid WHERE xchan in ( " . protect_sprintf($hashes) . " ) " );
|
$r = q("SELECT hash FROM pgrp left join pgrp_member on pgrp.id = pgrp_member.gid WHERE xchan in ( " . protect_sprintf($hashes) . " ) ");
|
||||||
if($r) {
|
if($r) {
|
||||||
foreach($r as $rr)
|
foreach($r as $rr)
|
||||||
$groups[] = $rr['hash'];
|
$groups[] = $rr['hash'];
|
||||||
|
Reference in New Issue
Block a user