aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-07-09 19:03:29 -0700
committerredmatrix <git@macgirvin.com>2016-07-09 19:03:29 -0700
commit917a465ccd7dfa4992241b1e5d4418b3a31f1615 (patch)
tree4743fcfc2e9997d35c1b0ef73317002c98255b64 /include
parente11330a5c8e5111d08d6aee1f4dc6dda6f7c7f2a (diff)
downloadvolse-hubzilla-917a465ccd7dfa4992241b1e5d4418b3a31f1615.tar.gz
volse-hubzilla-917a465ccd7dfa4992241b1e5d4418b3a31f1615.tar.bz2
volse-hubzilla-917a465ccd7dfa4992241b1e5d4418b3a31f1615.zip
more work on perms
Diffstat (limited to 'include')
-rw-r--r--include/permissions.php8
-rw-r--r--include/zot.php8
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]);
}