From b20887995a2b3277659e01d99ae4de238f7175ef Mon Sep 17 00:00:00 2001 From: Alexandre Hannud Abdo Date: Tue, 17 Jun 2014 04:26:18 -0300 Subject: Implements a new permission level PERMS_PENDING With this a user can allow some action to any user which connects to them, even before they've connected back. Ref. https://mobiliza.org.br/display/478d9e71eaf55748dc646d3990651d6d34cfb7db5c38360538ec730ca3ccf908@zothub.com Also some code cleanup and an alternative logic for handling notifications of permission changes in zot.php. This assumes that private posts are still restricted to people in your addressbook. Regardless of your global permissions, a pending channel won't get private posts, even if the post only has a deny clause not matching the pending channel. --- include/items.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index f71ebd503..c35a442b2 100755 --- a/include/items.php +++ b/include/items.php @@ -943,6 +943,8 @@ function map_scope($scope) { return 'network: red'; case PERMS_SITE: return 'site: ' . get_app()->get_hostname(); + case PERMS_PENDING: + return 'any connections'; case PERMS_CONTACTS: default: return 'contacts'; @@ -4085,7 +4087,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C } if(! array_key_exists('nouveau',$arr)) { - $sql_extra2 = " AND item.parent = item.id "; + $sql_extra2 = " AND item.parent = item.id "; $sql_extra3 = ''; } @@ -4126,12 +4128,12 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C $pager_sql = sprintf(" LIMIT %d, %d ",intval($arr['start']), intval($arr['records'])); if(array_key_exists('cmin',$arr) || array_key_exists('cmax',$arr)) { - if(($arr['cmin'] != 0) || ($arr['cmax'] != 99)) { + if(($arr['cmin'] != 0) || ($arr['cmax'] != 99)) { - // Not everybody who shows up in the network stream will be in your address book. - // By default those that aren't are assumed to have closeness = 99; but this isn't - // recorded anywhere. So if cmax is 99, we'll open the search up to anybody in - // the stream with a NULL address book entry. + // Not everybody who shows up in the network stream will be in your address book. + // By default those that aren't are assumed to have closeness = 99; but this isn't + // recorded anywhere. So if cmax is 99, we'll open the search up to anybody in + // the stream with a NULL address book entry. $sql_nets .= " AND "; -- cgit v1.2.3