aboutsummaryrefslogtreecommitdiffstats
path: root/include/security.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2017-02-13 20:38:11 -0500
committerAndrew Manning <tamanning@zoho.com>2017-02-13 20:38:11 -0500
commit69b08a20625ab49fb562f47a651cff7d554d000e (patch)
tree0b68c79a135cdc6da5c0f4df5fa32e133c97b615 /include/security.php
parent05fd5eb8be51ca1fee7b9ec108e87d3599833797 (diff)
parent8ed0913df61abdc9963a3f3e1b181ce695e273b5 (diff)
downloadvolse-hubzilla-69b08a20625ab49fb562f47a651cff7d554d000e.tar.gz
volse-hubzilla-69b08a20625ab49fb562f47a651cff7d554d000e.tar.bz2
volse-hubzilla-69b08a20625ab49fb562f47a651cff7d554d000e.zip
Merge remote-tracking branch 'upstream/dev' into doco
Diffstat (limited to 'include/security.php')
-rw-r--r--include/security.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/security.php b/include/security.php
index 57b33251f..b49ceec0d 100644
--- a/include/security.php
+++ b/include/security.php
@@ -553,7 +553,21 @@ function check_form_security_token_ForbiddenOnErr($typename = '', $formname = 'f
// var $contact_id = xchan_hash of connection
function init_groups_visitor($contact_id) {
- $groups = array();
+ $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'];
+ }
+ }
+
+ // physical groups this channel is a member of
+
$r = q("SELECT hash FROM groups left join group_member on groups.id = group_member.gid WHERE xchan = '%s' ",
dbesc($contact_id)
);