$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
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};
$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