diff options
author | friendica <info@friendica.com> | 2013-12-25 23:14:13 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-12-25 23:14:13 -0800 |
commit | f133218b33f0c7f9e4234aa2f4f85ae984ac726d (patch) | |
tree | c8c3c450b71241ce8791ef1bac868423dfed88ea /mod/acl.php | |
parent | 9d9fc6e2dce2bc98f714bd02a12645e1685e1d35 (diff) | |
download | volse-hubzilla-f133218b33f0c7f9e4234aa2f4f85ae984ac726d.tar.gz volse-hubzilla-f133218b33f0c7f9e4234aa2f4f85ae984ac726d.tar.bz2 volse-hubzilla-f133218b33f0c7f9e4234aa2f4f85ae984ac726d.zip |
don't include deleted folks in acl popup
Diffstat (limited to 'mod/acl.php')
-rw-r--r-- | mod/acl.php | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/mod/acl.php b/mod/acl.php index c9a4d417f..cd3e24367 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -49,9 +49,10 @@ function acl_init(&$a){ if ($type=='' || $type=='c'){ $r = q("SELECT COUNT(abook_id) AS c FROM abook left join xchan on abook_xchan = xchan_hash - WHERE abook_channel = %d AND not ( abook_flags & %d ) $sql_extra2" , + WHERE abook_channel = %d AND not ( abook_flags & %d ) and not (xchan_flags & %d ) $sql_extra2" , intval(local_user()), - intval(ABOOK_FLAG_SELF|ABOOK_FLAG_BLOCKED|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVED) + intval(ABOOK_FLAG_SELF|ABOOK_FLAG_BLOCKED|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVED), + intval(XCHAN_FLAGS_DELETED) ); $contact_count = (int)$r[0]['c']; } @@ -64,9 +65,11 @@ function acl_init(&$a){ $r = q("SELECT count(xchan_hash) as c FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d and ( (abook_their_perms = null) or (abook_their_perms & %d )) + and not ( xchan_flags & %d ) $sql_extra2 ", intval(local_user()), - intval(PERMS_W_MAIL) + intval(PERMS_W_MAIL), + intval(XCHAN_FLAGS_DELETED) ); if($r) @@ -78,8 +81,9 @@ function acl_init(&$a){ // autocomplete for Contacts $r = q("SELECT COUNT(abook_id) AS c FROM abook left join xchan on abook_xchan = xchan_hash - WHERE abook_channel = %d $sql_extra2" , - intval(local_user()) + WHERE abook_channel = %d and not ( xchan_flags & %d ) $sql_extra2" , + intval(local_user()), + intval(XCHAN_FLAGS_DELETED) ); $contact_count = (int)$r[0]['c']; @@ -121,32 +125,39 @@ function acl_init(&$a){ ); } } - + if ($type=='' || $type=='c') { $r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms FROM abook left join xchan on abook_xchan = xchan_hash - WHERE abook_channel = %d AND not ( abook_flags & %d ) $sql_extra2 order by xchan_name asc" , + WHERE abook_channel = %d AND not ( abook_flags & %d ) and not (xchan_flags & %d ) $sql_extra2 order by xchan_name asc" , intval(local_user()), - intval(ABOOK_FLAG_SELF|ABOOK_FLAG_BLOCKED|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVED) + intval(ABOOK_FLAG_SELF|ABOOK_FLAG_BLOCKED|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVED), + intval(XCHAN_FLAGS_DELETED) ); + } elseif($type == 'm') { $r = q("SELECT xchan_hash as id, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_url as url FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d and ( (abook_their_perms = null) or (abook_their_perms & %d )) + and not (xchan_flags & %d) $sql_extra3 ORDER BY `xchan_name` ASC ", intval(local_user()), - intval(PERMS_W_MAIL) + intval(PERMS_W_MAIL), + intval(XCHAN_FLAGS_DELETED) ); } elseif($type == 'a') { $r = q("SELECT abook_id as id, xchan_name as name, xchan_hash as hash, xchan_addr as nick, xchan_photo_s as micro, xchan_network as network, xchan_url as url, xchan_addr as attag , abook_their_perms FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d + and not (xchan_flags & %d) $sql_extra3 ORDER BY xchan_name ASC ", - intval(local_user()) + intval(local_user()), + intval(XCHAN_FLAGS_DELETED) + ); } elseif($type == 'x') { |