From 6e6b268e2523d95624361d29a8bd80b1133aa627 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 23 Jan 2013 21:15:40 -0800 Subject: auto permissions (such as for forums or whatever) - untested but might just work --- include/permissions.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'include/permissions.php') diff --git a/include/permissions.php b/include/permissions.php index 69f5d75af..ab40a7017 100644 --- a/include/permissions.php +++ b/include/permissions.php @@ -86,9 +86,10 @@ function get_all_perms($uid,$observer,$internal_use = true) { if($observer) { if(! $abook_checked) { $x = q("select abook_my_perms, abook_flags from abook - where abook_channel = %d and abook_xchan = '%s' limit 1", + where abook_channel = %d and abook_xchan = '%s' and not ( abook_flags & %d ) limit 1", intval($uid), - dbesc($observer) + dbesc($observer), + intval(ABOOK_FLAG_SELF) ); $abook_checked = true; } @@ -210,9 +211,10 @@ function perm_is_allowed($uid,$observer,$permission) { return false; if($observer) { - $x = q("select abook_my_perms, abook_flags from abook where abook_channel = %d and abook_xchan = '%s' limit 1", + $x = q("select abook_my_perms, abook_flags from abook where abook_channel = %d and abook_xchan = '%s' and not ( abook_flags & %d ) limit 1", intval($uid), - dbesc($observer) + dbesc($observer), + intval(ABOOK_FLAG_SELF) ); // If they're blocked - they can't read or write -- cgit v1.2.3