From f9fec7cf8f328f44a5550d50029ad115311eb45a Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 19 May 2013 17:57:06 -0700 Subject: issue with auto permissions --- mod/connections.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mod/connections.php') diff --git a/mod/connections.php b/mod/connections.php index 2f49ee374..507a587ba 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -350,7 +350,15 @@ function connections_content(&$a) { $unapproved = array('pending', t('Approve this connection'), '', t('Accept connection to allow communication')); foreach($global_perms as $k => $v) { - $perms[] = array('perms_' . $k, $v[3], (($contact['abook_their_perms'] & $v[1]) ? "1" : ""),((($contact['abook_my_perms'] & $v[1]) || $existing[$k]) ? "1" : ""), $v[1], (($channel[$v[0]] == PERMS_SPECIFIC) ? '' : '1'), $v[4]); + $thisperm = (($contact['abook_my_perms'] & $v[1]) ? "1" : ''); + + // For auto permissions (when $self is true) we don't want to look at existing + // permissions because they are enabled for the channel owner + + if((! $self) && ($existing[$k])) + $thisperm = "1"; + + $perms[] = array('perms_' . $k, $v[3], (($contact['abook_their_perms'] & $v[1]) ? "1" : ""),$thisperm, $v[1], (($channel[$v[0]] == PERMS_SPECIFIC) ? '' : '1'), $v[4]); } $o .= replace_macros($tpl,array( -- cgit v1.2.3