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).

stephan 2023-06-10 12:29 trunk
Commit c2b38f0aad8c253b20026b4e40591f5ce2e16036472383e4e3e5217e2c606e8b
2 files changed +7 -2 +42 -1
+7 -2
--- src/forum.c
+++ src/forum.c
@@ -1639,10 +1639,11 @@
16391639
int isDelete = 0;
16401640
int iClosed = 0;
16411641
int bSameUser; /* True if author is also the reader */
16421642
int bPreview; /* True in preview mode. */
16431643
int bPrivate; /* True if post is private (not yet moderated) */
1644
+ int bReply; /* True if replying to a post */
16441645
16451646
login_check_credentials();
16461647
if( !g.perm.WrForum ){
16471648
login_needed(g.anon.WrForum);
16481649
return;
@@ -1658,10 +1659,11 @@
16581659
if( P("cancel") ){
16591660
cgi_redirectf("%R/forumpost/%S",zFpid);
16601661
return;
16611662
}
16621663
bPreview = P("preview")!=0;
1664
+ bReply = P("reply")!=0;
16631665
iClosed = forum_rid_is_closed(fpid, 1);
16641666
isCsrfSafe = cgi_csrf_safe(1);
16651667
bPrivate = content_is_private(fpid);
16661668
bSameUser = login_is_individual()
16671669
&& fossil_strcmp(pPost->zUser, g.zLogin)==0;
@@ -1705,11 +1707,11 @@
17051707
&& (zContent = PDT("content",""))!=0
17061708
&& (!whitespace_only(zContent) || isDelete)
17071709
){
17081710
int done = 1;
17091711
const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE);
1710
- if( P("reply") ){
1712
+ if( bReply ){
17111713
done = forum_post(0, fpid, 0, 0, zMimetype, zContent,
17121714
forum_post_flags());
17131715
}else if( P("edit") || isDelete ){
17141716
done = forum_post(P("title"), 0, fpid, 0, zMimetype, zContent,
17151717
forum_post_flags());
@@ -1801,11 +1803,14 @@
18011803
}
18021804
}
18031805
forum_render_debug_options();
18041806
@ </form>
18051807
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
+ }
18071812
style_finish_page();
18081813
}
18091814
18101815
/*
18111816
** WEBPAGE: setup_forum
18121817
--- 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 @@
1212
then turning on the forum feature
1313
is just a matter of flipping some permission bits. There is
1414
no new software to install and configure, and the same logins
1515
and passwords work.
1616
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],
1818
[/wiki_rules|Fossil Wiki], or plain text. Whichever format is used, the result is
1919
displayed consistently across all platforms and operating systems and
2020
between mobile devices and desktops.
2121
2222
* <b>Editable:</b> Forum posts can be amended after they are sent,
@@ -366,5 +366,46 @@
366366
<li>A moderator viewing an update pending moderation sees two
367367
buttons at the bottom, "Approve" and "Reject" in place of the
368368
"Delete" button that the post's creator sees. Beware that both
369369
actions are durable and have no undo. Be careful!</li>
370370
</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.
371412
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button