summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Users.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-10-28 19:14:53 +0100
committerYorhel <git@yorhel.nl>2015-10-28 19:14:53 +0100
commit2375efc8a466bab145d6d62e3cbd34c623ba58bd (patch)
treef1a892f3e66e0bc98c2b6c7be498ea44aff359df /lib/VNDB/Handler/Users.pm
parent8987507d77fb5d375f48fb66ba89beaef8ad090c (diff)
Handler::Users: Don't hide list stats from own user or usermods
Diffstat (limited to 'lib/VNDB/Handler/Users.pm')
-rw-r--r--lib/VNDB/Handler/Users.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm
index c0836f97..6b30db7b 100644
--- a/lib/VNDB/Handler/Users.pm
+++ b/lib/VNDB/Handler/Users.pm
@@ -33,6 +33,7 @@ sub userpage {
return $self->resNotFound if !$u->{id};
my $votes = $u->{c_votes} && $self->dbVoteStats(uid => $uid);
+ my $list_visible = !$u->{hide_list} || ($self->authInfo->{id}||0) == $u->{id} || $self->authCan('usermod');
my $title = mt '_userpage_title', $u->{username};
$self->htmlHeader(title => $title, noindex => 1);
@@ -70,7 +71,7 @@ sub userpage {
Tr;
td mt '_userpage_votes';
td;
- if($u->{hide_list}) {
+ if(!$list_visible) {
txt mt '_userpage_hidden';
} elsif($votes) {
my($total, $count) = (0, 0);
@@ -100,7 +101,7 @@ sub userpage {
Tr;
td mt '_userpage_list';
- td $u->{hide_list} ? mt('_userpage_hidden') :
+ td !$list_visible ? mt('_userpage_hidden') :
mt('_userpage_list_item', $u->{releasecount}, $u->{vncount});
end;
@@ -117,7 +118,7 @@ sub userpage {
end 'table';
end 'div';
- if(!$u->{hide_list} && $votes) {
+ if($votes && $list_visible) {
div class => 'mainbox';
h1 mt '_userpage_votestats';
$self->htmlVoteStats(u => $u, $votes);