X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=lib%2FNDWeb%2FController%2FForum.pm;h=2de3ea82e105d286704caa3bbdc4be8ee64b1b83;hb=28cc9c2d61cf6ee0bfcd02c82e0195efaf6cf27a;hp=1a796246688d090a717e7046e02af5bb52c12e16;hpb=230e61ee1d992255138b56c50caf9cca52532c2b;p=ndwebbie.git diff --git a/lib/NDWeb/Controller/Forum.pm b/lib/NDWeb/Controller/Forum.pm index 1a79624..2de3ea8 100644 --- a/lib/NDWeb/Controller/Forum.pm +++ b/lib/NDWeb/Controller/Forum.pm @@ -159,6 +159,9 @@ sub board : Local { $c->forward('findBoard'); $board = $c->stash->{board}; + if ( !defined $board->{fbid}){ + $c->detach('/default'); + } my $threads = $dbh->prepare(q{SELECT ft.ftid,u.username,ft.subject ,count(NULLIF(COALESCE(fp.time > ftv.time,TRUE),FALSE)) AS unread,count(fp.fpid) AS posts @@ -180,6 +183,10 @@ sub board : Local { while (my $thread = $threads->fetchrow_hashref){ push @threads,$thread; } + + if ( !(defined $board->{post}) && @threads == 0){ + $c->acl_access_denied('test',$c->action,'No access to board') + } $c->stash(threads => \@threads); $c->forward('listModeratorBoards', [$board->{fbid}]) if $board->{moderate}; @@ -192,7 +199,8 @@ sub thread : Local { $c->forward('findThread'); unless ($c->stash->{thread}){ - $c->stash(template => 'access_denied.tt2'); + $c->stash(template => 'default.tt2'); + $c->res->status(404); return; } my $query = $dbh->prepare(q{SELECT uid,username FROM users u