diff options
author | friendica <info@friendica.com> | 2013-06-15 15:45:54 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-06-15 15:45:54 -0700 |
commit | ee21dfc2456dee1c5e0f22e8ca57a236d5c9a0b3 (patch) | |
tree | 88d85c485fa61d6e2966bd203f80f9ca83b4415a /include/permissions.php | |
parent | 87e4f50edab4e32a6191cd1fa5c1ee9f5dba791e (diff) | |
download | volse-hubzilla-ee21dfc2456dee1c5e0f22e8ca57a236d5c9a0b3.tar.gz volse-hubzilla-ee21dfc2456dee1c5e0f22e8ca57a236d5c9a0b3.tar.bz2 volse-hubzilla-ee21dfc2456dee1c5e0f22e8ca57a236d5c9a0b3.zip |
fix "new connection has less permissions than public"
Diffstat (limited to 'include/permissions.php')
-rw-r--r-- | include/permissions.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/permissions.php b/include/permissions.php index 071a599f8..bf380cf95 100644 --- a/include/permissions.php +++ b/include/permissions.php @@ -98,7 +98,7 @@ function get_all_perms($uid,$observer_xchan,$internal_use = true) { // If they're blocked - they can't read or write - if(($x) && (($x[0]['abook_flags'] & ABOOK_FLAG_BLOCKED) || ($x[0]['abook_flags'] & ABOOK_FLAG_PENDING))) { + if(($x) && ($x[0]['abook_flags'] & ABOOK_FLAG_BLOCKED)) { $ret[$perm_name] = false; continue; } @@ -164,13 +164,17 @@ function get_all_perms($uid,$observer_xchan,$internal_use = true) { // If PERMS_CONTACTS or PERMS_SPECIFIC, they need to be in your address book // $x is a valid address book entry - - if(! $x) { $ret[$perm_name] = false; continue; } + // They are in your address book, but haven't been approved + + if($x[0]['abook_flags'] & ABOOK_FLAG_PENDING) { + $ret[$perm_name] = false; + continue; + } if(($r) && ($r[0][$channel_perm] & PERMS_CONTACTS)) { @@ -242,7 +246,7 @@ function perm_is_allowed($uid,$observer_xchan,$permission) { // If they're blocked - they can't read or write - if(($x) && (($x[0]['abook_flags'] & ABOOK_FLAG_BLOCKED) || ($x[0]['abook_flags'] & ABOOK_FLAG_PENDING))) + if(($x) && ($x[0]['abook_flags'] & ABOOK_FLAG_BLOCKED)) return false; if(($x) && (! $global_perms[$permission][2]) && ($x[0]['abook_flags'] & ABOOK_FLAG_IGNORED)) @@ -287,6 +291,10 @@ function perm_is_allowed($uid,$observer_xchan,$permission) { return false; } + if($x[0]['abook_flags'] & ABOOK_FLAG_PENDING) { + return false; + } + if($r[0][$channel_perm] & PERMS_CONTACTS) { return true; } |