summaryrefslogtreecommitdiff
path: root/lib/VNWeb
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2021-06-24 10:51:03 +0200
committerYorhel <git@yorhel.nl>2021-06-24 10:51:03 +0200
commit32b11b261fe79491dfb73139487c259e0d041e2b (patch)
tree0665a996efa23cdc027d5328a3b5ac9db36d8feb /lib/VNWeb
parente63357abae9358508969578b6c6c45b4fc422804 (diff)
Reviews::List: hide flagged reviews for regular users
Diffstat (limited to 'lib/VNWeb')
-rw-r--r--lib/VNWeb/Reviews/List.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VNWeb/Reviews/List.pm b/lib/VNWeb/Reviews/List.pm
index bb65c75b..5d33e134 100644
--- a/lib/VNWeb/Reviews/List.pm
+++ b/lib/VNWeb/Reviews/List.pm
@@ -53,7 +53,9 @@ TUWF::get qr{/w}, sub {
my $u = $opt->{u} && tuwf->dbRowi('SELECT id, ', sql_user(), 'FROM users u WHERE id =', \$opt->{u});
return tuwf->resNotFound if $u && !$u->{id};
- my $where = $u ? sql 'w.uid =', \$u->{id} : '1=1';
+ my $where = sql_and
+ $u ? sql 'w.uid =', \$u->{id} : (),
+ auth->isMod ? () : 'NOT w.c_flagged';
my $count = tuwf->dbVali('SELECT COUNT(*) FROM reviews w WHERE', $where);
my $lst = tuwf->dbPagei({results => 50, page => $opt->{p}}, '
SELECT w.id, w.vid, w.isfull, w.c_up, w.c_down, w.c_flagged, w.c_count, w.c_lastnum, v.title, uv.vote