public forum fallback checking (when custom/expert permissions are applied) was looking at owner rather than observer perms

This commit is contained in:
redmatrix 2016-08-22 17:04:13 -07:00
parent d6d21cb5f6
commit e967bc9c45

View File

@ -3708,6 +3708,8 @@ function zotinfo($arr) {
} }
} }
$ztarget_hash = (($ztarget && $zsig) ? make_xchan_hash($ztarget,$zsig) : '' );
$r = null; $r = null;
if(strlen($zhash)) { if(strlen($zhash)) {
@ -3783,11 +3785,11 @@ function zotinfo($arr) {
if($role === 'forum' || $role === 'repository') { if($role === 'forum' || $role === 'repository') {
$public_forum = true; $public_forum = true;
} }
else { elseif($ztarget_hash) {
// check if it has characteristics of a public forum based on custom permissions. // check if it has characteristics of a public forum based on custom permissions.
$t = q("select * from abconfig where abconfig.cat = 'my_perms' and abconfig.chan = %d and abconfig.xchan = '%s' and abconfig.k in ('tag_deliver', 'send_stream') ", $t = q("select * from abconfig where abconfig.cat = 'my_perms' and abconfig.chan = %d and abconfig.xchan = '%s' and abconfig.k in ('tag_deliver', 'send_stream') ",
intval($e['channel_id']), intval($e['channel_id']),
dbesc($e['channel_hash']) dbesc($ztarget_hash)
); );
$ch = 0; $ch = 0;
@ -3889,9 +3891,6 @@ function zotinfo($arr) {
$ret['follow_url'] = z_root() . '/follow?f=&url=%s'; $ret['follow_url'] = z_root() . '/follow?f=&url=%s';
$ztarget_hash = (($ztarget && $zsig)
? make_xchan_hash($ztarget,$zsig)
: '' );
$permissions = get_all_perms($e['channel_id'],$ztarget_hash,false); $permissions = get_all_perms($e['channel_id'],$ztarget_hash,false);