X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fsecurity.php;h=cb4587fbdaf4e904def5679c4ff589eda714fe83;hb=39d8fec290613cac87c2821b9f7b20fa94d319ca;hp=d92f48a084e6fd226f091d98252fb75727bb25e6;hpb=5c3bce30d65ad219030a84e57f3336cc69f21ead;p=friendica.git diff --git a/include/security.php b/include/security.php index d92f48a084..cb4587fbda 100644 --- a/include/security.php +++ b/include/security.php @@ -266,14 +266,8 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null) * Profile owner - everything is visible */ - if($local_user) { - if($local_user == $owner_id) { - $sql = ''; - } - else { - /* logged in user can see hidden walls and feeds that are blocked to unknown users (private == 2) */ - $sql = " AND private != 1 "; - } + if($local_user && ($local_user == $owner_id)) { + $sql = ''; } /** @@ -306,7 +300,7 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null) } $sql = sprintf( - " AND ( private = 0 OR ( private in (1,2) AND wall = 1 AND ( allow_cid = '' OR allow_cid REGEXP '<%d>' ) + /*" AND ( private = 0 OR ( private in (1,2) AND wall = 1 AND ( allow_cid = '' OR allow_cid REGEXP '<%d>' ) AND ( deny_cid = '' OR NOT deny_cid REGEXP '<%d>' ) AND ( allow_gid = '' OR allow_gid REGEXP '%s' ) AND ( deny_gid = '' OR NOT deny_gid REGEXP '%s'))) @@ -315,6 +309,15 @@ function item_permissions_sql($owner_id,$remote_verified = false,$groups = null) intval($remote_user), dbesc($gs), dbesc($gs) +*/ + " AND ( private = 0 OR ( private in (1,2) AND wall = 1 + AND ( NOT (deny_cid REGEXP '<%d>' OR deny_gid REGEXP '%s') + AND ( allow_cid REGEXP '<%d>' OR allow_gid REGEXP '%s' OR ( allow_cid = '' AND allow_gid = ''))))) + ", + intval($remote_user), + dbesc($gs), + intval($remote_user), + dbesc($gs) ); } }