diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/permissions.php | 8 | ||||
-rw-r--r-- | include/zot.php | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/include/permissions.php b/include/permissions.php index dff7d65ff..5eb602ce0 100644 --- a/include/permissions.php +++ b/include/permissions.php @@ -291,7 +291,7 @@ function perm_is_allowed($uid, $observer_xchan, $permission) { // First find out what the channel owner declared permissions to be. - $channel_perm = \Zotlabs\Access\PermissionLimits($uid,$permission); + $channel_perm = \Zotlabs\Access\PermissionLimits::Get($uid,$permission); $r = q("select channel_pageflags, channel_moved, channel_hash from channel where channel_id = %d limit 1", intval($uid) @@ -299,6 +299,9 @@ function perm_is_allowed($uid, $observer_xchan, $permission) { if(! $r) return false; + + $blocked_anon_perms = \Zotlabs\Access\Permissions::BlockedAnonPerms(); + if($observer_xchan) { if($channel_perm & PERMS_AUTHED) return true; @@ -314,7 +317,7 @@ function perm_is_allowed($uid, $observer_xchan, $permission) { if(($x) && intval($x[0]['abook_blocked'])) return false; - if(($x) && (! $global_perms[$permission][2]) && intval($x[0]['abook_ignored'])) + if(($x) && in_array($permission,$blocked_anon_perms) && intval($x[0]['abook_ignored'])) return false; if(! $x) { @@ -326,7 +329,6 @@ function perm_is_allowed($uid, $observer_xchan, $permission) { $abperms = load_abconfig($uid,$observer_xchan); } - $blocked_anon_perms = \Zotlabs\Access\Permissions::BlockedAnonPerms(); // system is blocked to anybody who is not authenticated diff --git a/include/zot.php b/include/zot.php index 6dd789181..c30940613 100644 --- a/include/zot.php +++ b/include/zot.php @@ -410,10 +410,10 @@ function zot_refresh($them, $channel = null, $force = false) { if($permissions && is_array($permissions)) { foreach($permissions as $k => $v) { // The connected permission means you are in their address book - if($k === 'connected') { - $connected_set = intval($v); - continue; - } + //if($k === 'connected') { + // $connected_set = intval($v); + // continue; + //} if(($v) && (array_key_exists($k,$global_perms))) { $their_perms = $their_perms | intval($global_perms[$k][1]); } |