Notifications
Clear all

[Solved] Force moderation for logged in users

11 Posts
4 Users
0 Reactions
170 Views
Posts: 6
 GAR1
Topic starter
(@gar1)
Active Member
Joined: 1 month ago

Hello.

We force registration for all our forum users.  When someone registers they are assigned to a usergroup that we created that is associated to the Subscriber WP user role.  When a user creates a post, it is published immediately and is not held for moderation.  We would like all posts to be held for moderation.

Under the Usergroups settings this particular usergroup has the Front - Can pass moderation box unchecked so it is not behaving as expected.

Is there another setting I may be missing to force moderation for all posts?  Does the fact that the user is logged in publish their posts without moderation?

We have extensive WP coding experience so if there are hooks we can take advantage of to accomplish this, please suggest the proper hook and/or please point us to some documentation that may help.

Thank you.

10 Replies
Tutrix
Posts: 1356
(@tutrix)
Noble Member
Joined: 4 years ago

Hi @gar1 

Dashboard > wpForo > Settings > Spam Protection > Posts must be manually approved

Posts: 6
 GAR1
Topic starter
(@gar1)
Active Member
Joined: 1 month ago

Thank you for the suggestion but we already have that enabled.

Do you know if moderation rules are ignored when the user has an account and is logged in?

Tutrix
Posts: 1356
(@tutrix)
Noble Member
Joined: 4 years ago

@gar1 

User is New (under hard spam control) during first [X] posts

[X]

what value are you using

5
10
100
1000
10000
or
0

5 Replies
 GAR1
(@gar1)
Joined: 1 month ago

Active Member
Posts: 6

@tutrix - It is currently set to 5

Tutrix
(@tutrix)
Joined: 4 years ago

Noble Member
Posts: 1356

@gar1 

Logically, there are only 5 posts that need to be manually approved.

 GAR1
(@gar1)
Joined: 1 month ago

Active Member
Posts: 6

@tutrix Unfortunately the system doesn't seem to be following the logic.  My test user's first post was published immediately and was not held for moderation.

I am looking to force all posts to be held for moderation.  I do not want any threshold to be met which allows for posts to be published immediately.

Please advise if this is possible.  It seems I have configured the plugin as you and the documentation has suggested but still no posts are held for moderation.

Thank you.

Sofy
 Sofy
Admin
(@sofy)
Joined: 7 years ago

Support Team
Posts: 4573

@gar1 

Please navigate to Dashboard > Forums > Usergroups admin page.

Edit all Usergroups one by one and make sure the “Can pass moderation” permission is not enabled.

 GAR1
(@gar1)
Joined: 1 month ago

Active Member
Posts: 6

@sofy Up until a few minutes ago all of our usergroups but one (the Admin usergroup) was set to disable can pass moderation.  I just disabled it on the admin usergroup as well.  All of our usergroups now have can pass moderation disabled and the problem persists.

I just created the second post for my test user and the post was published immediately and nothing is in the moderation queue.

Please let me know if you have any other suggestions/ideas.

Thank you.

Posts: 6
 GAR1
Topic starter
(@gar1)
Active Member
Joined: 1 month ago

I started looking into the plugin code and I discovered a function called auto_moderate in the Moderation class.  It seems to be doing the checks for whether or not a post needs to be moderated.

It is checking the user's usergroup and looking for can( 'em' ) or can( 'aup' ) and setting the item status accordingly.  Seems like status set to 1 forces moderation.

In the database this particular usergroup has the following json stored...

a:37:{s:2:"mf";i:0;s:2:"ms";i:0;s:2:"mt";i:0;s:2:"vm";i:0;s:3:"aum";i:0;s:3:"vmg";i:0;s:2:"mp";i:0;s:3:"mth";i:0;s:2:"em";i:1;s:2:"bm";i:0;s:2:"dm";i:0;s:3:"aup";i:0;s:9:"view_stat";i:1;s:4:"vmem";i:1;s:4:"vprf";i:1;s:4:"vpra";i:1;s:4:"vprs";i:0;s:3:"upc";i:1;s:3:"upa";i:1;s:3:"ups";i:1;s:2:"va";i:1;s:3:"vmu";i:0;s:3:"vmm";i:0;s:3:"vmt";i:1;s:4:"vmct";i:1;s:3:"vmr";i:1;s:3:"vmw";i:1;s:4:"vmsn";i:1;s:4:"vmrd";i:1;s:3:"vml";i:1;s:3:"vmo";i:1;s:3:"vms";i:1;s:4:"vmam";i:1;s:4:"vwpm";i:1;s:3:"caa";i:1;s:12:"vt_add_topic";i:1;i:0;s:0:"";}

You can see the value of em is 1 and in auto_moderate finds the value of 1 for em and sets the status to 0 thus allowing immediate publication.

This is my basic understanding but I'd be happy for you to clarify if I have it wrong.

Is this correct?  What setting causes the system to store em to 1 in the database?  What does em stand for and what does aup stand for?

If I want to force all posts and replies to be queued for moderation I was thinking of overriding this function in our child theme and returning status = 1 always.  Does that sound like sound logic?  Since I do not see any hooks here, would overriding the function in our child theme be problematic with WPForo plugin updates?

I would greatly appreciate it if you can answer my questions.

Thank you.

 

 

1 Reply
Robert
Admin
(@robert)
Joined: 8 years ago

Support Team
Posts: 10545

Hi @gar1 

This must work:
Dashboard > wpForo > Settings > Spam Protection > Posts must be manually approved

Please check it again, then go to Dashboard > wpForo > Overview admin page, find the [Delete all caches] button and click it. If this option doesn't work then your forum is crashed. This is the only option which will work for all non-moderator and non-admin users.

When you check it, make sure you're logged in with and account which has Registered or other non-admin non-mederator usergroup.