- Fixed bug with being able to post comments while you shouldn't. Patch by

Garym.
4.3.x
Dries Buytaert 2003-09-03 20:18:03 +00:00
parent 2c342df5a9
commit 30c546931d
2 changed files with 14 additions and 16 deletions

View File

@ -769,6 +769,7 @@ function comment_link($type, $node = 0, $main = 0) {
} }
} }
else { else {
if ($node->comment == 2) {
if (user_access("post comments")) { if (user_access("post comments")) {
$links[] = l(t("add new comment"), "comment/reply/$node->nid", array("title" => t("Add a new comment to this page."))); $links[] = l(t("add new comment"), "comment/reply/$node->nid", array("title" => t("Add a new comment to this page.")));
} }
@ -778,6 +779,7 @@ function comment_link($type, $node = 0, $main = 0) {
} }
} }
} }
}
else { else {
/* /*
** Node page: add a "post comment" link if the user is allowed to ** Node page: add a "post comment" link if the user is allowed to
@ -792,9 +794,6 @@ function comment_link($type, $node = 0, $main = 0) {
$links[] = theme("comment_post_forbidden"); $links[] = theme("comment_post_forbidden");
} }
} }
else {
$links[] = t("Closed discussion: you can't post new comments.");
}
} }
} }

View File

@ -769,6 +769,7 @@ function comment_link($type, $node = 0, $main = 0) {
} }
} }
else { else {
if ($node->comment == 2) {
if (user_access("post comments")) { if (user_access("post comments")) {
$links[] = l(t("add new comment"), "comment/reply/$node->nid", array("title" => t("Add a new comment to this page."))); $links[] = l(t("add new comment"), "comment/reply/$node->nid", array("title" => t("Add a new comment to this page.")));
} }
@ -778,6 +779,7 @@ function comment_link($type, $node = 0, $main = 0) {
} }
} }
} }
}
else { else {
/* /*
** Node page: add a "post comment" link if the user is allowed to ** Node page: add a "post comment" link if the user is allowed to
@ -792,9 +794,6 @@ function comment_link($type, $node = 0, $main = 0) {
$links[] = theme("comment_post_forbidden"); $links[] = theme("comment_post_forbidden");
} }
} }
else {
$links[] = t("Closed discussion: you can't post new comments.");
}
} }
} }