Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-18-2012, 05:05 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to force banning reason?

Hi all, has anyone managed to force a moderator/staff to enter a reason for banning? i cant for the life of me find how to do it, so if someone could oblige i'd be very happy

The force would need to be when banning via modcp/admincp AND when using the "delete posts as spam"

EDIT: vb3.8
Reply With Quote
  #2  
Old 12-19-2012, 01:15 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The "delete posts as spam" is done in inlinemod.php. I think you could use hook inlinemod_start and check for $_POST['do'] == 'dodeletespam' and look at $_POST['reason'].

For the admincp/modcp it's done in modcp/banning.php, but there aren't any hooks there. But I guess you could use admin_global and mod_global, and look for $_POST['do'] == 'dobanuser' (it doesn't look like any other script use that value of 'do').
Reply With Quote
  #3  
Old 12-19-2012, 06:45 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Kevin, i was looking at manipulating the <input(s) for the inline mod. I tried your first suggestion
PHP Code:
if(THIS_SCRIPT == 'inlinemod.php'){
if(
$_POST['do'] == 'dodeletespam' AND $_POST['reason']==""){
$_POST['reason']=="Generic Message";
}

but it didnt affect the message, a blank was still recorded. Ideally if it's blank i want to send them back to the page they clicked the 'dodeletespam' button on, all the same trying to inject my own text as above didnt work, have i missed something?
Reply With Quote
  #4  
Old 12-19-2012, 08:58 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You have if (THIS_SCRIPT == 'inlinemod.php') when it should just be 'inlinemod'.


I think you could do something like
Code:
eval(standard_error(fetch_error('reason_blank')));

and then make an error phrase with varname reason_blank. I havem't tried it but other errors seem to work that way. I'm not sure if that sends the user back to the previous page or if they'd have to use the back button.
Reply With Quote
Благодарность от:
Simon Lloyd
  #5  
Old 12-19-2012, 09:12 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

DOH!
Should wake up properly before trying to write stuff

Thanks again Kevin!

--------------- Added [DATE]1355914190[/DATE] at [TIME]1355914190[/TIME] ---------------

Ok using mod_global (as it's always accessing the mod folder) i did this
PHP Code:
if(THIS_SCRIPT == 'banning'){
if(
$_POST['do'] == 'dobanuser' AND $vbulletin->GPC['reason'] ==""){
eval(
standard_error(fetch_error('reason_blank')));
}

I tried $_POST['reason'] and ['ban_reason'] and ['banreason'] none of which prevented me banning via modcp (or admincp>modcp) without a reason, do i need a global variable here? in banning.php the reason is simply ['reason']?
Reply With Quote
  #6  
Old 12-19-2012, 10:06 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, right, I didn't think about the fact that it's always the modcp global.php. Anyway, there are no THIS_SCRIPT values in the cp scripts. But I did a search and no other scripts use a 'do' value of 'dobanuser', so it's probably OK just to check that. I think there is a way in php to check the requested file name (obviously the current file will always be global.php), if you want to look in to that.
Reply With Quote
  #7  
Old 12-19-2012, 10:35 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well, still using the mod_global hook and removing the script check works to some extent, when trying to ban a user you now just get a white page rather than the error message but the dobanuser isn't being processed, so the question now is how to show the error message and return them to the banning page?
Reply With Quote
  #8  
Old 12-19-2012, 02:28 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, right - I didn't think about that. You don't want to use the eval(standard_error(... method in the control panel because it doesn't use templates, probably things aren't set up right to use that. What you could do is just change the value of 'do' to show the banning page again, but printing out an error might be difficult since the output hasn't been started yet. I guess another option is to use the admincp 'print' function to print out your own error message and tell the user to use the back button. Or maybe you could copy the code for the banning page (the section in if ($_REQUEST['do'] == 'banuser')) and use it to reproduce the banning page, but add your error message somewhere.
Reply With Quote
  #9  
Old 12-19-2012, 03:04 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

All sorted, in modcp i print the error and include a back button, in inlinemod i eval the error message and added the back button to the phrase

--------------- Added [DATE]1355933191[/DATE] at [TIME]1355933191[/TIME] ---------------

Thanks for your help - as usual
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:12 PM.


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.04031 seconds
  • Memory Usage 2,250KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (1)post_thanks_box_bit
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete