Fossil

Check-in [6a667edb]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the redirect that occurs after a forum post is rejected by the moderator.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | forum-v2
Files: files | file ages | folders
SHA3-256:6a667edb0964140c1be60ef1d6bbcfff32a2d4258d98ff9c1be66e878234f082
User & Date: drh 2018-07-31 15:49:10
Context
2018-07-31
17:05
Try to make moderation a little easier, as recent experience suggests that will be a big deal with the forum. check-in: a9e5a1ee user: drh tags: forum-v2
15:49
Fix the redirect that occurs after a forum post is rejected by the moderator. check-in: 6a667edb user: drh tags: forum-v2
14:22
Add the backoffice-nodelay setting as a temporary measure to aid in debugging the unseemly delays currently being experienced in the UI. check-in: 0efaa982 user: drh tags: forum-v2
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/forum.c.

371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
...
781
782
783
784
785
786
787






788

789



790
791
792
793
794
795
796
...
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
    }else{
      fpid = p->fpid;
      zUuid = p->zUuid;
      pPost = pOPost;
    }
    zSel = p->fpid==target ? " forumSel" : "";
    if( p->nIndent==1 ){
      @ <div id='forum(%d(fpid)' class='forumHierRoot%s(zSel)'>
    }else{
      @ <div id='forum%d(fpid)' class='forumHier%s(zSel)' \
      @ style='margin-left: %d((p->nIndent-1)*3)ex;'>
    }
    pPost = manifest_get(fpid, CFTYPE_FORUM, 0);
    if( pPost==0 ) continue;
    if( pPost->zThreadTitle ){
................................................................................
  if( g.perm.ModForum && isCsrfSafe ){
    if( P("approve") ){
      moderation_approve(fpid);
      cgi_redirectf("%R/forumpost/%S",P("fpid"));
      return;
    }
    if( P("reject") ){






      moderation_disapprove(fpid);

      cgi_redirectf("%R/forumpost/%S",P("fpid"));



      return;
    }
  }
  isDelete = P("nullout")!=0;
  if( P("submit") && isCsrfSafe ){
    int done = 1;
    const char *zMimetype = PD("mimetype","text/x-fossil-wiki");
................................................................................
** threads.  Also show a search box at the top if search is enabled,
** and a button for creating a new thread, if enabled.
*/
void forum_main_page(void){
  Stmt q;
  int iLimit, iOfst;
  login_check_credentials();
  sqlite3_int64 iNow = time(NULL);
  if( !g.perm.RdForum ){
    login_needed(g.anon.RdForum);
    return;
  }
  style_header("Forum");
  if( g.perm.WrForum ){
    style_submenu_element("New Message","%R/forumnew");







|







 







>
>
>
>
>
>

>
|
>
>
>







 







<







371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
...
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
...
903
904
905
906
907
908
909

910
911
912
913
914
915
916
    }else{
      fpid = p->fpid;
      zUuid = p->zUuid;
      pPost = pOPost;
    }
    zSel = p->fpid==target ? " forumSel" : "";
    if( p->nIndent==1 ){
      @ <div id='forum%d(fpid)' class='forumHierRoot%s(zSel)'>
    }else{
      @ <div id='forum%d(fpid)' class='forumHier%s(zSel)' \
      @ style='margin-left: %d((p->nIndent-1)*3)ex;'>
    }
    pPost = manifest_get(fpid, CFTYPE_FORUM, 0);
    if( pPost==0 ) continue;
    if( pPost->zThreadTitle ){
................................................................................
  if( g.perm.ModForum && isCsrfSafe ){
    if( P("approve") ){
      moderation_approve(fpid);
      cgi_redirectf("%R/forumpost/%S",P("fpid"));
      return;
    }
    if( P("reject") ){
      char *zParent = 
        db_text(0,
          "SELECT uuid FROM forumpost, blob"
          " WHERE forumpost.fpid=%d AND blob.rid=forumpost.firt",
          fpid
        );
      moderation_disapprove(fpid);
      if( zParent ){
        cgi_redirectf("%R/forumpost/%S",zParent);
      }else{
        cgi_redirectf("%R/forum");
      }
      return;
    }
  }
  isDelete = P("nullout")!=0;
  if( P("submit") && isCsrfSafe ){
    int done = 1;
    const char *zMimetype = PD("mimetype","text/x-fossil-wiki");
................................................................................
** threads.  Also show a search box at the top if search is enabled,
** and a button for creating a new thread, if enabled.
*/
void forum_main_page(void){
  Stmt q;
  int iLimit, iOfst;
  login_check_credentials();

  if( !g.perm.RdForum ){
    login_needed(g.anon.RdForum);
    return;
  }
  style_header("Forum");
  if( g.perm.WrForum ){
    style_submenu_element("New Message","%R/forumnew");