fixed a typo in Forum.pm and a privileges problem in Post.pm

This commit is contained in:
JT Smith 2003-11-19 03:21:12 +00:00
parent d150016395
commit c3f98f8821
2 changed files with 5 additions and 3 deletions

View file

@ -130,7 +130,7 @@ Deccrements this forum's reply counter.
=cut
sub incrementReplies {
sub decrementReplies {
my ($self) = @_;
WebGUI::SQL->write("update forum set replies=replies-1 where forumId=".$self->get("forumId"));
}
@ -143,7 +143,7 @@ Decrements this forum's thread counter.
=cut
sub incrementReplies {
sub decrementThreads {
my ($self) = @_;
WebGUI::SQL->write("update forum set threads=threads-1 where forumId=".$self->get("forumId"));
}

View file

@ -100,7 +100,9 @@ The unique identifier to check privileges against. Defaults to the current user.
sub canView {
my ($self, $userId) = @_;
$userId = $session{user}{userId} unless ($userId);
if ($self->get("status") eq "deleted") {
if ($self->get("status") eq "approved" || $self->get("status") eq "archived") {
return 1;
} elsif ($self->get("status") eq "deleted") {
return 0;
} elsif ($self->get("status") eq "denied" && $userId == $self->get("userId")) {
return 1;