Skip to content

Commit

Permalink
Merge pull request #1403 from kaberett/hide-banned-users-from-profile
Browse files Browse the repository at this point in the history
Hide banned users from profile (fixes #1279)
  • Loading branch information
afuna committed Jun 7, 2015
2 parents c67c2f6 + 7a16c46 commit fbe709e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions htdocs/profile.bml
Expand Up @@ -742,6 +742,18 @@ body<=
@posting_access_to_userids, @posting_access_from_userids,
);

# pull in list of banned users
my $banned = LJ::load_rel_user($u, 'B') || [];
my %banned_users = map { $_ => 1 } @$banned;

# remove banned users from lists to display
@$_ = grep { !exists $banned_users{ $_ }, @$_ }
foreach ( \@trusted_userids, \@watched_userids, \@trusted_by_userids, \@watched_by_userids,
\@mutually_trusted_userids, \@mutually_watched_userids, \@mutually_watched_userids,
\@not_mutually_trusted_userids, \@not_mutually_watched_userids,
\@not_mutually_trusted_by_userids, \@not_mutually_watched_by_userids, \@members_userids,
\@member_of_userids, \@admin_of_userids, \@posting_access_to_userids, \@posting_access_from_userids );

# presort various userid arrays
@$_ = sort { $us->{$a}->display_name cmp $us->{$b}->display_name } @$_
foreach ( \@trusted_userids, \@watched_userids, \@trusted_by_userids, \@watched_by_userids,
Expand Down

0 comments on commit fbe709e

Please sign in to comment.