vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Adding new permission checks for moderation (https://vborg.vbsupport.ru/showthread.php?t=270613)

RHSeeger 09-20-2011 04:09 PM

Adding new permission checks for moderation
 
I'm trying to add an additional check to determine if a user is allowed to moderate a post/thread. Specifically:
  • We're only concerned with forum threads/posts
  • Each thread has an new field added to it
  • Each user has values for that field that, if a given thread has the same value, indicates they can moderate that thread/post
  • If the thread/post was originally created, the check is bypassed
I have the code for the described checks written via functions (can_moderate_posts($userid, $postids) and can_moderate_threads($userid, $threadids)), and I'm to the point where I need to determine exactly how to tell the system that these checks need to happen... and that's where I'm hoping to ask for some insight.

From what I can tell, the following pages implement actual thread/post moderation actions:

postings.php
Moderation actions taken from the moderation control panel. It looks like I'd want to hook off threadmanage_start since the values of the user taking the action, the action, and the items (threads of posts) are known by this time. This appears to be the only place this hook is called.

inlinemod.php
Moderation actions taken from the normal forums via the inline moderation capabilities. It looks like I'd want to hook off inlinemod_start since the values of the user taking the action, the action, and the items (threads of posts) are known by this time. This appears to be the only place this hook is called.

member_inlinemod.php
I'm not sure on this one. The code "seems" like it's handling moderation, but I'm not sure how it's actually used. Is this file used for actually moderating forum threads and posts, or is it used for a different purpose (like moderating visitor messages on profile pages, etc)

Any suggestions, comments, or corrections would be very much appreciated.

Thanks in advance.


All times are GMT. The time now is 06:31 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01074 seconds
  • Memory Usage 1,709KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete