From 2a525922929d5d9d54fd898e6f1658f0b959e667 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 12 Feb 2017 17:40:18 -0800 Subject: testing and bug fixes virtual profile groups --- Zotlabs/Module/Lockview.php | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Lockview.php b/Zotlabs/Module/Lockview.php index 7d1d8a43f..fc7d5c7c8 100644 --- a/Zotlabs/Module/Lockview.php +++ b/Zotlabs/Module/Lockview.php @@ -32,10 +32,10 @@ class Lockview extends \Zotlabs\Web\Controller { if(! $item_id) killme(); - if (!in_array($type, array('item','photo','event', 'menu_item', 'chatroom'))) + if (! in_array($type, array('item', 'photo', 'attach', 'event', 'menu_item', 'chatroom'))) killme(); - //we have different naming in in menu_item table and chatroom table + // we have different naming in in menu_item table and chatroom table switch($type) { case 'menu_item': $id = 'mitem_id'; @@ -101,6 +101,22 @@ class Lockview extends \Zotlabs\Web\Controller { stringify_array_elms($deny_groups,true); stringify_array_elms($deny_users,true); + + $profile_groups = []; + if($allowed_groups) { + foreach($allowed_groups as $g) { + if(substr($g,0,4) === '\'vp.') { + $profile_groups[] = '\'' . substr($g,4); + } + } + } + if(count($profile_groups)) { + $r = q("SELECT profile_name FROM profile WHERE profile_guid IN ( " . implode(', ', $profile_groups) . " )"); + if($r) + foreach($r as $rr) + $l[] = '
  • ' . t('Profile','acl') . ' ' . $rr['profile_name'] . '
  • '; + } + if(count($allowed_groups)) { $r = q("SELECT gname FROM groups WHERE hash IN ( " . implode(', ', $allowed_groups) . " )"); if($r) @@ -120,6 +136,25 @@ class Lockview extends \Zotlabs\Web\Controller { } } } + + + $profile_groups = []; + if($deny_groups) { + foreach($deny_groups as $g) { + if(substr($g,0,4) === '\'vp.') { + $profile_groups[] = '\'' . substr($g,4); + } + } + } + if(count($profile_groups)) { + $r = q("SELECT profile_name FROM profile WHERE profile_guid IN ( " . implode(', ', $profile_groups) . " )"); + if($r) + foreach($r as $rr) + $l[] = '
  • ' . t('Profile','acl') . ' ' . $rr['profile_name'] . '
  • '; + } + + + if(count($deny_groups)) { $r = q("SELECT gname FROM groups WHERE hash IN ( " . implode(', ', $deny_groups) . " )"); if($r) -- cgit v1.2.3