connections edit: show existing permissions as checked (or unchecked) even if disabled

This commit is contained in:
friendica 2012-12-31 01:17:52 -08:00
parent ba0876d011
commit db16ea8527

View File

@ -308,8 +308,11 @@ function connections_content(&$a) {
$channel = $a->get_channel(); $channel = $a->get_channel();
$global_perms = get_perms(); $global_perms = get_perms();
$existing = get_all_perms(local_user(),$contact);
foreach($global_perms as $k => $v) { 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]) ? "1" : ""), $v[1], (($channel[$v[0]] == PERMS_SPECIFIC) ? '' : '1'), $v[4]); $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]);
} }