vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Allow Mods a temporary ban of users (https://vborg.vbsupport.ru/showthread.php?t=39584)

Hotte 06-06-2002 10:00 PM

Allow Mods a temporary ban of users
 
Hi
I´ve wrote a little hack upon request of my "Main"-Moderators.
This hack allows them to temporary ban a given user per Userid. Simply userid, reason and how many hours. The banned user will see a modified no-permission screen when he tries to login. The User can automaticly access the board again, when the entered time is over.
For the other hackers: Feel free to modify the hack and distribute a "better" version of this if you want.

Sry for my bad english.

Hotte 06-07-2002 08:15 PM

Screenshot of entering a new ban

Hotte 06-07-2002 08:16 PM

Screenshot of the banlist

Hotte 06-07-2002 08:16 PM

Screenshot of a banned user

Lesane 06-07-2002 08:38 PM

Pretty cool, i will try this one out. Thanks.

Keyser S?ze 06-07-2002 09:10 PM

thats a real good hack, once i get it translated ill try installing it

GamerX 06-07-2002 09:20 PM

Could you post up the translated please when you tralsate it?

Hotte 06-07-2002 09:36 PM

The hack is now in english

Keyser S?ze 06-07-2002 10:12 PM

see, im looking at it thinking "am i loosing my mind", cuz its in english,

looks like a good hack, having some forum issues right now so ill install it tomarrow

MarkG 06-07-2002 10:26 PM

GREAT hack

BUT

the banned user is totally cut off from the forum
i'd like it that he could do whatever i'm allowing the banned users group to do

Hotte 06-07-2002 10:32 PM

hmmm
a temp ban is usefull, so that this user can think about that, what he has done. So why let him do anything?

MarkG 06-07-2002 11:01 PM

well we have a different style of bans on our forums: they last from 1 day to 2 weeks and the restriction is on posting. reading the forums as well as using the pm system is allowed

currently we have to use a thread in a private forum to keep a log of these bans. this hack would be great if it moved the user to and from the banned users group...

Boofo 06-07-2002 11:12 PM

How would I make this so the Admin and Super Moderator can use it and only the moderators you select?

Hotte 06-07-2002 11:20 PM

Quote:

Originally posted by Boofo
How would I make this so the Admin and Super Moderator can use it and only the moderators you select?
In banuser.php @ line 10:

if ($bbuserinfo[userid]!=1 and !$ismod=$DB_site->query_first("SELECT * FROM moderator WHERE userid=$bbuserinfo[userid] and forumid=2")) {

change this to:

PHP Code:

if (
    
$bbuserinfo[usergroupid]!=6
    
and $bbuserinfo[usergroupid]!=5
    
and $bbuserinfo[userid]!=x
    
and $bbuserinfo[userid]!=y
    
and $bbuserinfo[userid]!=z


$bbuserinfo[usergroupid]!=6 for the admin-group
$bbuserinfo[usergroupid]!=5 for the supermoderators
$bbuserinfo[userid]!=x-z for the userid?s for the moderators you select

If the moderators are all in 1 usergroup (and only them, no one else) you can use the way with the usergroupid.

Erwin 06-07-2002 11:44 PM

This is an interesting hack. I will look into it soon. It would be good if the hack allows for ban periods of days or weeks. But I suppose you can just work it out by working out the number of hours.

Hotte 06-07-2002 11:48 PM

If you want a user ban some days or weeks increase the hours :) it works. calc.exe is a good friend then :)

Chris M 06-08-2002 01:22 AM

This is an excellent hack...

*Installs*

Satan

ManagerJosh 06-08-2002 06:12 AM

Using this hack is very good. Big problem is when they see the error, they will freak out.

I suggest a countdown, or a statement that says you have been banned for a certain number of minutes/hrs/etc

I don't think a countdown is good, but just a plain statement saying how long he has been banned.

Something like this prevents users from leaving the forums (which is something you do not want happening)

RDX1 06-08-2002 06:52 AM

well if you allow guests to view the board, all they have to do is logout

MarkG 06-08-2002 07:15 AM

Quote:

well if you allow guests to view the board, all they have to do is logout
true, but that's not the most effective solution, is it? ;)
plus, i want to leave the ability to pm...



if you want ban in days and not hours, just add *24 after every 60*60 in the banuser.php

Hotte 06-08-2002 09:52 AM

Quote:

Originally posted by NerdNations
well if you allow guests to view the board, all they have to do is logout
Yes, but they don?t have a logout-link on the page :) If they want to view, the user has to delete the cookie manually and most user don?t do that.

Quote:

Originally posted by MarkG
if you want ban in days and not hours, just add *24 after every 60*60 in the banuser.php
Don?t forget the /24 in action==edit at line 36

Boofo 06-08-2002 11:41 AM

Is there a way to add an option to ban them for hours, days, weeks or months? Some reasons for banning may be more severe than others. :)

Quote:

Originally posted by Hotte
Don?t forget the /24 in action==edit at line 36 [/B]

ladyfyre 06-09-2002 09:49 PM

Ok...i have looked and looked and looked...and still am just not seeing it....

Where is the link to allow the bans to be set?

I mean...there has to be some interface into the existing scripts....if i try to go straight to the script itself, it gives me just a blank grey screen.

So where are the links supposed to be? There are none mentioned in the install file.

Smoothie 06-09-2002 10:19 PM

You can add the link in your forums/mod/index.php file

Smoothie 06-09-2002 10:21 PM

Look for code
PHP Code:

makenavoption("Ban","user.php?action=find","|"); 

and add below:
PHP Code:

makenavoption("Temp Ban","banuser.php?","|"); 


Boofo 06-09-2002 10:32 PM

Do you need to have the banuser.php in the mod directory then? And how would you link to it in the admin cp?

Quote:

Originally posted by Smoothie
Look for code
PHP Code:

makenavoption("Ban","user.php?action=find","|"); 

and add below:
PHP Code:

makenavoption("Temp Ban","banuser.php?","|"); 



Smoothie 06-09-2002 10:42 PM

This hack I just learned can be quite harmful. What stops a mod, super mod, from banning an admin?

Boofo 06-09-2002 11:00 PM

Any way to do a check to see if it is a mod, super mod or admin before it allows you to ban them? :)

Quote:

Originally posted by Smoothie
This hack I just learned can be quite harmful. What stops a mod, super mod, from banning an admin?

ladyfyre 06-09-2002 11:52 PM

Nope...that isn't the answer.

I know how to make those types of links, but did as you said, and it still just gives me a blank grey page.

Since i am not editing the banuser.php at all, then i can't have mis-installed it.....

Something is just not working right here.

Boofo 06-09-2002 11:59 PM

Did you add the necessary code to the phpinclude template? :)

Quote:

Originally posted by ladyfyre
Nope...that isn't the answer.

I know how to make those types of links, but did as you said, and it still just gives me a blank grey page.

Since i am not editing the banuser.php at all, then i can't have mis-installed it.....

Something is just not working right here.


Smoothie 06-10-2002 12:01 AM

did you run the query on your database and add the template?

ladyfyre 06-10-2002 12:05 AM

yes :)

Smoothie 06-10-2002 12:41 AM

from the bottom of the install text:
Quote:

Hint:
In banuser.php at line 10:
if ($bbuserinfo[userid]!=1 and !$ismod=$DB_site->query_first("SELECT * FROM moderator WHERE userid=$bbuserinfo[userid] and forumid=2")) {

This is the permcheck if the user who tries accessing this file is authorized. In this case if the user ist not the administrator who was createn by the vbulletin-installation and is not a moderator of forumid 2, the script will quit. Change it to whatever you want. In Example to allow all moderators access delete lines 10-13 from the script.

I know, this hack is not "the best way" to code something, but it works :)
Are you userid 1?

ladyfyre 06-10-2002 01:04 AM

ok...that was it...


i tried using the format above to change it to look up for the usergroup for Admins and SuperModerators, but the only way it works is if i set it to allow the userid or else delete the permissions completely :(

any idea why the usergroup solution is bombing?

Boofo 06-10-2002 01:17 AM

Post #14 in this thread has the code to allow usergroups. :) That's what I am using.

Quote:

Originally posted by ladyfyre
ok...that was it...


i tried using the format above to change it to look up for the usergroup for Admins and SuperModerators, but the only way it works is if i set it to allow the userid or else delete the permissions completely :(

any idea why the usergroup solution is bombing?


Smoothie 06-10-2002 01:41 AM

Yea, I can't allow mods/supermods to use this until someone can post an update to the code to disallow banning of admins. The way it works now is any mod/supermod that has permissions to temp ban, can also temp ban an admin.

ladyfyre 06-10-2002 01:45 AM

That is what i was using. I just get back:

Parse error: parse error in /banuser.php on line 13

Code used is:


PHP Code:

// HF-Mods perms
        
if_(    
        
____$bbuserinfo[usergroupid]!=
        
____and_$bbuserinfo
[usergroupid]!=5
        
____and_$bbuserinfo
[userid]!=44
        
____and_$bbuserinfo
[userid]!723
        
____and_$bbuserinfo
[userid]!=4267
        
{       
        
cpfooter();
        exit;



Line 13 is the one referring to usergroupid 6

Boofo 06-10-2002 02:16 AM

That doesn't seem to work here now. I went back to the original file and it works that way. I ran it from the admin directory though. I don't want any mods playing with it until I can get it working so no one can ban the admin. :)

Quote:

Originally posted by ladyfyre
That is what i was using. I just get back:

Parse error: parse error in /banuser.php on line 13

Code used is:


PHP Code:

// HF-Mods perms
        
if_(    
        
____$bbuserinfo[usergroupid]!=
        
____and_$bbuserinfo
[usergroupid]!=5
        
____and_$bbuserinfo
[userid]!=44
        
____and_$bbuserinfo
[userid]!723
        
____and_$bbuserinfo
[userid]!=4267
        
{       
        
cpfooter();
        exit;



Line 13 is the one referring to usergroupid 6


Smoothie 06-10-2002 02:25 AM

If you just insert your own userid, you can still run it from your mod/index.php This way it can be run from your forums options drop down box in the forum, bottom right. No one will be able to ban you, because it looks for that userid, and if its not the same one as the person trying to access the file, the script will not run.

Boofo 06-10-2002 02:58 AM

Ok, you lost me here. What do I need to do where to do what? :)

Quote:

Originally posted by Smoothie
If you just insert your own userid, you can still run it from your mod/index.php This way it can be run from your forums options drop down box in the forum, bottom right. No one will be able to ban you, because it looks for that userid, and if its not the same one as the person trying to access the file, the script will not run.


All times are GMT. The time now is 03:16 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.01427 seconds
  • Memory Usage 1,835KB
  • 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
  • (7)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete