Fossil SCM
Add some docs about closing forum posts to www/forum.wiki. When replying to a post, to not show the Close option at the bottom of the page (as it would apply to the response, which cannot be closed because it has no hash).
Commit
c2b38f0aad8c253b20026b4e40591f5ce2e16036472383e4e3e5217e2c606e8b
Parent
673dc38ffb4b444…
2 files changed
+7
-2
+42
-1
+7
-2
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -1639,10 +1639,11 @@ | ||
| 1639 | 1639 | int isDelete = 0; |
| 1640 | 1640 | int iClosed = 0; |
| 1641 | 1641 | int bSameUser; /* True if author is also the reader */ |
| 1642 | 1642 | int bPreview; /* True in preview mode. */ |
| 1643 | 1643 | int bPrivate; /* True if post is private (not yet moderated) */ |
| 1644 | + int bReply; /* True if replying to a post */ | |
| 1644 | 1645 | |
| 1645 | 1646 | login_check_credentials(); |
| 1646 | 1647 | if( !g.perm.WrForum ){ |
| 1647 | 1648 | login_needed(g.anon.WrForum); |
| 1648 | 1649 | return; |
| @@ -1658,10 +1659,11 @@ | ||
| 1658 | 1659 | if( P("cancel") ){ |
| 1659 | 1660 | cgi_redirectf("%R/forumpost/%S",zFpid); |
| 1660 | 1661 | return; |
| 1661 | 1662 | } |
| 1662 | 1663 | bPreview = P("preview")!=0; |
| 1664 | + bReply = P("reply")!=0; | |
| 1663 | 1665 | iClosed = forum_rid_is_closed(fpid, 1); |
| 1664 | 1666 | isCsrfSafe = cgi_csrf_safe(1); |
| 1665 | 1667 | bPrivate = content_is_private(fpid); |
| 1666 | 1668 | bSameUser = login_is_individual() |
| 1667 | 1669 | && fossil_strcmp(pPost->zUser, g.zLogin)==0; |
| @@ -1705,11 +1707,11 @@ | ||
| 1705 | 1707 | && (zContent = PDT("content",""))!=0 |
| 1706 | 1708 | && (!whitespace_only(zContent) || isDelete) |
| 1707 | 1709 | ){ |
| 1708 | 1710 | int done = 1; |
| 1709 | 1711 | const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE); |
| 1710 | - if( P("reply") ){ | |
| 1712 | + if( bReply ){ | |
| 1711 | 1713 | done = forum_post(0, fpid, 0, 0, zMimetype, zContent, |
| 1712 | 1714 | forum_post_flags()); |
| 1713 | 1715 | }else if( P("edit") || isDelete ){ |
| 1714 | 1716 | done = forum_post(P("title"), 0, fpid, 0, zMimetype, zContent, |
| 1715 | 1717 | forum_post_flags()); |
| @@ -1801,11 +1803,14 @@ | ||
| 1801 | 1803 | } |
| 1802 | 1804 | } |
| 1803 | 1805 | forum_render_debug_options(); |
| 1804 | 1806 | @ </form> |
| 1805 | 1807 | forum_emit_js(); |
| 1806 | - forumpost_emit_closed_state(fpid, iClosed); | |
| 1808 | + if( bReply==0 ){ | |
| 1809 | + /* Do not show CLOSE option for new posts/responses. */ | |
| 1810 | + forumpost_emit_closed_state(fpid, iClosed); | |
| 1811 | + } | |
| 1807 | 1812 | style_finish_page(); |
| 1808 | 1813 | } |
| 1809 | 1814 | |
| 1810 | 1815 | /* |
| 1811 | 1816 | ** WEBPAGE: setup_forum |
| 1812 | 1817 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -1639,10 +1639,11 @@ | |
| 1639 | int isDelete = 0; |
| 1640 | int iClosed = 0; |
| 1641 | int bSameUser; /* True if author is also the reader */ |
| 1642 | int bPreview; /* True in preview mode. */ |
| 1643 | int bPrivate; /* True if post is private (not yet moderated) */ |
| 1644 | |
| 1645 | login_check_credentials(); |
| 1646 | if( !g.perm.WrForum ){ |
| 1647 | login_needed(g.anon.WrForum); |
| 1648 | return; |
| @@ -1658,10 +1659,11 @@ | |
| 1658 | if( P("cancel") ){ |
| 1659 | cgi_redirectf("%R/forumpost/%S",zFpid); |
| 1660 | return; |
| 1661 | } |
| 1662 | bPreview = P("preview")!=0; |
| 1663 | iClosed = forum_rid_is_closed(fpid, 1); |
| 1664 | isCsrfSafe = cgi_csrf_safe(1); |
| 1665 | bPrivate = content_is_private(fpid); |
| 1666 | bSameUser = login_is_individual() |
| 1667 | && fossil_strcmp(pPost->zUser, g.zLogin)==0; |
| @@ -1705,11 +1707,11 @@ | |
| 1705 | && (zContent = PDT("content",""))!=0 |
| 1706 | && (!whitespace_only(zContent) || isDelete) |
| 1707 | ){ |
| 1708 | int done = 1; |
| 1709 | const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE); |
| 1710 | if( P("reply") ){ |
| 1711 | done = forum_post(0, fpid, 0, 0, zMimetype, zContent, |
| 1712 | forum_post_flags()); |
| 1713 | }else if( P("edit") || isDelete ){ |
| 1714 | done = forum_post(P("title"), 0, fpid, 0, zMimetype, zContent, |
| 1715 | forum_post_flags()); |
| @@ -1801,11 +1803,14 @@ | |
| 1801 | } |
| 1802 | } |
| 1803 | forum_render_debug_options(); |
| 1804 | @ </form> |
| 1805 | forum_emit_js(); |
| 1806 | forumpost_emit_closed_state(fpid, iClosed); |
| 1807 | style_finish_page(); |
| 1808 | } |
| 1809 | |
| 1810 | /* |
| 1811 | ** WEBPAGE: setup_forum |
| 1812 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -1639,10 +1639,11 @@ | |
| 1639 | int isDelete = 0; |
| 1640 | int iClosed = 0; |
| 1641 | int bSameUser; /* True if author is also the reader */ |
| 1642 | int bPreview; /* True in preview mode. */ |
| 1643 | int bPrivate; /* True if post is private (not yet moderated) */ |
| 1644 | int bReply; /* True if replying to a post */ |
| 1645 | |
| 1646 | login_check_credentials(); |
| 1647 | if( !g.perm.WrForum ){ |
| 1648 | login_needed(g.anon.WrForum); |
| 1649 | return; |
| @@ -1658,10 +1659,11 @@ | |
| 1659 | if( P("cancel") ){ |
| 1660 | cgi_redirectf("%R/forumpost/%S",zFpid); |
| 1661 | return; |
| 1662 | } |
| 1663 | bPreview = P("preview")!=0; |
| 1664 | bReply = P("reply")!=0; |
| 1665 | iClosed = forum_rid_is_closed(fpid, 1); |
| 1666 | isCsrfSafe = cgi_csrf_safe(1); |
| 1667 | bPrivate = content_is_private(fpid); |
| 1668 | bSameUser = login_is_individual() |
| 1669 | && fossil_strcmp(pPost->zUser, g.zLogin)==0; |
| @@ -1705,11 +1707,11 @@ | |
| 1707 | && (zContent = PDT("content",""))!=0 |
| 1708 | && (!whitespace_only(zContent) || isDelete) |
| 1709 | ){ |
| 1710 | int done = 1; |
| 1711 | const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE); |
| 1712 | if( bReply ){ |
| 1713 | done = forum_post(0, fpid, 0, 0, zMimetype, zContent, |
| 1714 | forum_post_flags()); |
| 1715 | }else if( P("edit") || isDelete ){ |
| 1716 | done = forum_post(P("title"), 0, fpid, 0, zMimetype, zContent, |
| 1717 | forum_post_flags()); |
| @@ -1801,11 +1803,14 @@ | |
| 1803 | } |
| 1804 | } |
| 1805 | forum_render_debug_options(); |
| 1806 | @ </form> |
| 1807 | forum_emit_js(); |
| 1808 | if( bReply==0 ){ |
| 1809 | /* Do not show CLOSE option for new posts/responses. */ |
| 1810 | forumpost_emit_closed_state(fpid, iClosed); |
| 1811 | } |
| 1812 | style_finish_page(); |
| 1813 | } |
| 1814 | |
| 1815 | /* |
| 1816 | ** WEBPAGE: setup_forum |
| 1817 |
+42
-1
| --- www/forum.wiki | ||
| +++ www/forum.wiki | ||
| @@ -12,11 +12,11 @@ | ||
| 12 | 12 | then turning on the forum feature |
| 13 | 13 | is just a matter of flipping some permission bits. There is |
| 14 | 14 | no new software to install and configure, and the same logins |
| 15 | 15 | and passwords work. |
| 16 | 16 | |
| 17 | - * <b>Consistent Display:</b> Forum posts can be in [/md_rules|Markdown], | |
| 17 | + * <b>Consistent Display:</b> Forum posts can be in [/md_rules|Markdown], | |
| 18 | 18 | [/wiki_rules|Fossil Wiki], or plain text. Whichever format is used, the result is |
| 19 | 19 | displayed consistently across all platforms and operating systems and |
| 20 | 20 | between mobile devices and desktops. |
| 21 | 21 | |
| 22 | 22 | * <b>Editable:</b> Forum posts can be amended after they are sent, |
| @@ -366,5 +366,46 @@ | ||
| 366 | 366 | <li>A moderator viewing an update pending moderation sees two |
| 367 | 367 | buttons at the bottom, "Approve" and "Reject" in place of the |
| 368 | 368 | "Delete" button that the post's creator sees. Beware that both |
| 369 | 369 | actions are durable and have no undo. Be careful!</li> |
| 370 | 370 | </ol> |
| 371 | + | |
| 372 | +<h2 id="close-post">Closing Forum Posts</h2> | |
| 373 | + | |
| 374 | +As of version 2.23, the forum interface supports the notion of | |
| 375 | +"closing" posts. By default, only users with the [./caps/index.md|'s' | |
| 376 | +and 'a' capabilities] may close or re-open posts, or reply to closed | |
| 377 | +posts. If the [/help?cmd=forum-close-policy|forum-close-policy | |
| 378 | +configuration option] is enabled then users with | |
| 379 | +[./caps/index.md|forum-moderator permissions] may also perform those | |
| 380 | +actions. | |
| 381 | + | |
| 382 | +Closing a post has the following implications: | |
| 383 | + | |
| 384 | + * Only authorized users may edit or respond to such posts, recursively | |
| 385 | + through all responses of that post. | |
| 386 | + * Only authorized users may re-open a closed post. | |
| 387 | + | |
| 388 | +A forum thread may be closed at any given point in the conversation, | |
| 389 | +not just the starting point of the thread, and affects that specific | |
| 390 | +post and all existing responses to it. | |
| 391 | + | |
| 392 | +Note that closing a post is effectively an "advisory lock" and may be | |
| 393 | +bypassed. Any user, admin or otherwise, who can push changes to a | |
| 394 | +repository may bypass closure of a post by setting the appropriate | |
| 395 | +artifact tags on a local copy and pushing those changes to a remote | |
| 396 | +copy of the forum. | |
| 397 | + | |
| 398 | +Closing may be achieved in two ways: | |
| 399 | + | |
| 400 | + * When a given post is selected in the web interface, a "Close" or | |
| 401 | + "Re-open" button will appear under the post if the user has | |
| 402 | + permissions to perform that operation. | |
| 403 | + * A Close option is added at the bottom of the Edit page, permissions | |
| 404 | + permitting. | |
| 405 | + | |
| 406 | +Though forum users are permitted to delete their own posts, they are | |
| 407 | +not permitted, without appropriate permissions, to close their own | |
| 408 | +posts. This is intentional, as closing one's own post can be used to | |
| 409 | +antagonize other forum-goers. For example, by posting something | |
| 410 | +trollish or highly contraversial in nature and closing the post to | |
| 411 | +further responses. | |
| 371 | 412 |
| --- www/forum.wiki | |
| +++ www/forum.wiki | |
| @@ -12,11 +12,11 @@ | |
| 12 | then turning on the forum feature |
| 13 | is just a matter of flipping some permission bits. There is |
| 14 | no new software to install and configure, and the same logins |
| 15 | and passwords work. |
| 16 | |
| 17 | * <b>Consistent Display:</b> Forum posts can be in [/md_rules|Markdown], |
| 18 | [/wiki_rules|Fossil Wiki], or plain text. Whichever format is used, the result is |
| 19 | displayed consistently across all platforms and operating systems and |
| 20 | between mobile devices and desktops. |
| 21 | |
| 22 | * <b>Editable:</b> Forum posts can be amended after they are sent, |
| @@ -366,5 +366,46 @@ | |
| 366 | <li>A moderator viewing an update pending moderation sees two |
| 367 | buttons at the bottom, "Approve" and "Reject" in place of the |
| 368 | "Delete" button that the post's creator sees. Beware that both |
| 369 | actions are durable and have no undo. Be careful!</li> |
| 370 | </ol> |
| 371 |
| --- www/forum.wiki | |
| +++ www/forum.wiki | |
| @@ -12,11 +12,11 @@ | |
| 12 | then turning on the forum feature |
| 13 | is just a matter of flipping some permission bits. There is |
| 14 | no new software to install and configure, and the same logins |
| 15 | and passwords work. |
| 16 | |
| 17 | * <b>Consistent Display:</b> Forum posts can be in [/md_rules|Markdown], |
| 18 | [/wiki_rules|Fossil Wiki], or plain text. Whichever format is used, the result is |
| 19 | displayed consistently across all platforms and operating systems and |
| 20 | between mobile devices and desktops. |
| 21 | |
| 22 | * <b>Editable:</b> Forum posts can be amended after they are sent, |
| @@ -366,5 +366,46 @@ | |
| 366 | <li>A moderator viewing an update pending moderation sees two |
| 367 | buttons at the bottom, "Approve" and "Reject" in place of the |
| 368 | "Delete" button that the post's creator sees. Beware that both |
| 369 | actions are durable and have no undo. Be careful!</li> |
| 370 | </ol> |
| 371 | |
| 372 | <h2 id="close-post">Closing Forum Posts</h2> |
| 373 | |
| 374 | As of version 2.23, the forum interface supports the notion of |
| 375 | "closing" posts. By default, only users with the [./caps/index.md|'s' |
| 376 | and 'a' capabilities] may close or re-open posts, or reply to closed |
| 377 | posts. If the [/help?cmd=forum-close-policy|forum-close-policy |
| 378 | configuration option] is enabled then users with |
| 379 | [./caps/index.md|forum-moderator permissions] may also perform those |
| 380 | actions. |
| 381 | |
| 382 | Closing a post has the following implications: |
| 383 | |
| 384 | * Only authorized users may edit or respond to such posts, recursively |
| 385 | through all responses of that post. |
| 386 | * Only authorized users may re-open a closed post. |
| 387 | |
| 388 | A forum thread may be closed at any given point in the conversation, |
| 389 | not just the starting point of the thread, and affects that specific |
| 390 | post and all existing responses to it. |
| 391 | |
| 392 | Note that closing a post is effectively an "advisory lock" and may be |
| 393 | bypassed. Any user, admin or otherwise, who can push changes to a |
| 394 | repository may bypass closure of a post by setting the appropriate |
| 395 | artifact tags on a local copy and pushing those changes to a remote |
| 396 | copy of the forum. |
| 397 | |
| 398 | Closing may be achieved in two ways: |
| 399 | |
| 400 | * When a given post is selected in the web interface, a "Close" or |
| 401 | "Re-open" button will appear under the post if the user has |
| 402 | permissions to perform that operation. |
| 403 | * A Close option is added at the bottom of the Edit page, permissions |
| 404 | permitting. |
| 405 | |
| 406 | Though forum users are permitted to delete their own posts, they are |
| 407 | not permitted, without appropriate permissions, to close their own |
| 408 | posts. This is intentional, as closing one's own post can be used to |
| 409 | antagonize other forum-goers. For example, by posting something |
| 410 | trollish or highly contraversial in nature and closing the post to |
| 411 | further responses. |
| 412 |