aboutsummaryrefslogtreecommitdiffstats
path: root/include/security.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-02-12 15:56:33 -0800
committerzotlabs <mike@macgirvin.com>2017-02-12 15:56:33 -0800
commitccdfbc721fa0cf6710cce262cbaa219e2803e8c2 (patch)
tree3ff4e912a8496d6e6ae7abb530afc80eeba8b24c /include/security.php
parentbc3605a5025908ae0835c057cb7caa1bc26d9c37 (diff)
downloadvolse-hubzilla-ccdfbc721fa0cf6710cce262cbaa219e2803e8c2.tar.gz
volse-hubzilla-ccdfbc721fa0cf6710cce262cbaa219e2803e8c2.tar.bz2
volse-hubzilla-ccdfbc721fa0cf6710cce262cbaa219e2803e8c2.zip
Create virtual privacy groups for private profile member lists
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)
);