diff options
author | Yorhel <git@yorhel.nl> | 2009-08-12 16:02:26 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-08-12 16:02:26 +0200 |
commit | ef6e1d16bf0e6be3dde6f28d645a10fd89f0de6b (patch) | |
tree | a9a7f261abe409f4988b00abe1f15848d0a87ebb /lib/VNDB | |
parent | e8ed9663331278c6bd555f7a69c45e84fc4bb34e (diff) |
Allow a usermod to browse a users' list even when it's hidden
To make sure we can still see a troll if he marks his list as hidden.
Only admins have this usermod privilege, and admins are assumed to have
raw SQL access anyway.
Diffstat (limited to 'lib/VNDB')
-rw-r--r-- | lib/VNDB/Handler/ULists.pm | 4 | ||||
-rw-r--r-- | lib/VNDB/Handler/Users.pm | 4 | ||||
-rw-r--r-- | lib/VNDB/Util/CommonHTML.pm | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/VNDB/Handler/ULists.pm b/lib/VNDB/Handler/ULists.pm index 05b1f60f..2d8e0e0d 100644 --- a/lib/VNDB/Handler/ULists.pm +++ b/lib/VNDB/Handler/ULists.pm @@ -99,7 +99,7 @@ sub wishlist { my $own = $self->authInfo->{id} && $self->authInfo->{id} == $uid; my $u = $self->dbUserGet(uid => $uid)->[0]; - return 404 if !$u || !$own && !$u->{show_list}; + return 404 if !$u || !$own && !($u->{show_list} || $self->authCan('usermod')); my $f = $self->formValidate( { name => 'p', required => 0, default => 1, template => 'int' }, @@ -198,7 +198,7 @@ sub vnlist { my $own = $self->authInfo->{id} && $self->authInfo->{id} == $uid; my $u = $self->dbUserGet(uid => $uid)->[0]; - return 404 if !$u || !$own && !$u->{show_list}; + return 404 if !$u || !$own && !($u->{show_list} || $self->authCan('usermod')); my $f = $self->formValidate( { name => 'p', required => 0, default => 1, template => 'int' }, diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm index 45d12e35..4dee6105 100644 --- a/lib/VNDB/Handler/Users.pm +++ b/lib/VNDB/Handler/Users.pm @@ -539,8 +539,8 @@ sub list { a href => '/u'.$l->{id}, $l->{username}; end; td class => 'tc2', date $l->{registered}; - td class => 'tc3'; - lit !$l->{show_list} ? '-' : !$l->{c_votes} ? 0 : + td class => 'tc3'.(!$l->{show_list} && $self->authCan('usermod') ? ' linethrough' : ''); + lit !$l->{show_list} && !$self->authCan('usermod') ? '-' : !$l->{c_votes} ? 0 : qq|<a href="/u$l->{id}/list">$l->{c_votes}</a>|; end; td class => 'tc4'; diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm index 2446457d..84436c8d 100644 --- a/lib/VNDB/Util/CommonHTML.pm +++ b/lib/VNDB/Util/CommonHTML.pm @@ -46,7 +46,7 @@ sub htmlMainTabs { end; } - if($type eq 'u' && $obj->{show_list}) { + if($type eq 'u' && ($obj->{show_list} || $self->authCan('usermod'))) { li $sel eq 'wish' ? (class => 'tabselected') : (); a href => "/$id/wish", 'wishlist'; end; |