vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Cookie Ban ?? (https://vborg.vbsupport.ru/showthread.php?t=122527)

aveon 11-12-2006 04:35 AM

i kno bro but for couple of chump all the members from that region will be band its not fear to others and dinamic ips changes on every restart if the modem ill try to see if i can entegrate Invision Power Boards cookie ban mod for vbulletin i dnd ewen kno how

?dit (Aveon)

here is a code ifound on internet can we integrate this for vb

Quote:

################################################## ############
## MOD Title: Ban_cookie
## MOD Author: Merlin Sythove < Merlin@silvercircle.org >
## MOD Description: Give banned users a cookie and check that too,
## in addition to the existing checks. Once the cookie is in place:
## if it matches the database, the user is banned, even if the user
## gets another IP or is not logged in so the user ID is unknown.
## MOD Version: 0.9
##
## Installation Level: (Easy/Intermediate/Advanced)
## Installation Time: 5 Minutes
## Files To Edit: includes/sessions.php
## Included Files: (N/A)
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
################################################## ############
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
################################################## ############
## Author Notes:
##
################################################## ############
## MOD History:
##
## 2005-1101: Version 0.9
##
################################################## ############
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
################################################## ############

#
#-----[ OPEN ]------------------------------------------
#
includes/sessions.php

#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT ban_ip, ban_userid, ban_email
FROM " . BANLIST_TABLE . "
WHERE ban_ip IN ('" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . $user_ip_parts[4] . "', '" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . "ff', '" . $user_ip_parts[1] . $user_ip_parts[2] . "ffff', '" . $user_ip_parts[1] . "ffffff')
OR ban_userid = $user_id";
if ( $user_id != ANONYMOUS )
{
$sql .= " OR ban_email LIKE '" . str_replace("\'", "''", $userdata['user_email']) . "'
OR ban_email LIKE '" . substr(str_replace("\'", "''", $userdata['user_email']), strpos(str_replace("\'", "''", $userdata['user_email']), "@")) . "'";
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not obtain ban information', '', __LINE__, __FILE__, $sql);
}

if ( $ban_info = $db->sql_fetchrow($result) )
{
if ( $ban_info['ban_ip'] || $ban_info['ban_userid'] || $ban_info['ban_email'] )
{
message_die(CRITICAL_MESSAGE, 'You_been_banned');
}
}

#
#-----[ REPLACE WITH ]------------------------------------------
#
//START MOD Ban_cookie
//Give banned users a cookie and check that too, in addition to the existing checks.
//Once the cookie is in place: if it matches the database, the user is banned,
//even if the user gets another IP or is not logged in so the user ID is unknown.

//Get cookie ban settings.
$ban_cookie = '';
$banned_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'].'_banned_id']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'].'_banned_id'] : '';
$banned_ip = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'].'_banned_ip']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'].'_banned_ip'] : '';

//Yes, cookie ban settings were there. See if they match the database.
//If not, delete cookie.
if ($banned_ip || $banned_id)
{
$sql = "SELECT *
FROM " . BANLIST_TABLE . "
WHERE ";
$sql .= ($banned_ip) ? " ban_ip = '" . $banned_ip . "'" : '';
$sql .= ($banned_id) ? ($banned_ip ? ' OR ' : '') . ' ban_userid = ' . $banned_id : '';
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not obtain ban information', '', __LINE__, __FILE__, $sql);
}
if ( $ban_info = $db->sql_fetchrow($result) )
{
$ban_cookie = ( $ban_info['ban_ip'] || $ban_info['ban_userid']);
}
//There was a cookie but no match in the database, so the ban is lifted:
//delete the cookie by setting the expiry time 1 hour ago
if (! $ban_cookie)
{
if ($banned_ip) setcookie($board_config['cookie_name'].'_banned_ip',$banned_ip, time()-3600);
if ($banned_id) setcookie($board_config['cookie_name'].'_banned_id',$banned_id, time()-3600);
}
}
//Have $ban_cookie, if not empty, the user is banned via a cookie.
//If empty, then there was no cookie, or there was no LONGER a database match so the cookie was deleted

//Check if there is database ban info - this is roughly the original ban code
$ban_database = '';
$sql = "SELECT *
FROM " . BANLIST_TABLE . "
WHERE ban_ip IN ('" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . $user_ip_parts[4] . "', '" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . "ff', '" . $user_ip_parts[1] . $user_ip_parts[2] . "ffff', '" . $user_ip_parts[1] . "ffffff')
OR ban_userid = $user_id";
if ( $user_id != ANONYMOUS )
{
$sql .= " OR ban_email LIKE '" . str_replace("\'", "''", $userdata['user_email']) . "'
OR ban_email LIKE '" . substr(str_replace("\'", "''", $userdata['user_email']), strpos(str_replace("\'", "''", $userdata['user_email']), "@")) . "'";
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not obtain ban information', '', __LINE__, __FILE__, $sql);
}
if ( $ban_info = $db->sql_fetchrow($result) )
{
$ban_database = ( $ban_info['ban_ip'] || $ban_info['ban_userid'] || $ban_info['ban_email'] );
//Fill these variables from database if not filled from cookie yet
if (! $banned_ip) $banned_ip = $ban_info['ban_ip'];
if (! $banned_id) $banned_id = $ban_info['ban_userid'];
}

//User is banned in some way?
if ($ban_cookie || $ban_database)
{
//Set the ban_cookie, time it for 1 year. The time restarts every time the user comes here
if ($banned_ip) setcookie($board_config['cookie_name'].'_banned_ip',$banned_ip, time()+365*24*3600);
if ($banned_id) setcookie($board_config['cookie_name'].'_banned_id',$banned_id, time()+365*24*3600);
//Close the forum to this person
message_die(CRITICAL_MESSAGE, 'You_been_banned');
}
//END MOD Ban_cookie

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

G0F0RBR0KE 11-12-2006 05:02 AM

Alrite...I'll see if I can get it transfer to vBulletin... I'll try my best...

aveon 11-12-2006 05:04 AM

Quote:

Originally Posted by EvilAkuma
Alrite...I'll see if I can get it transfer to vBulletin... I'll try my best...


thnx bro if u want any type of style im here im professional on html but not on php thanx again

G0F0RBR0KE 11-12-2006 05:20 AM

Before I decide to start on it..please tell me what version vB you're running...

aveon 11-12-2006 05:26 AM

Quote:

Originally Posted by EvilAkuma
Before I decide to start on it..please tell me what version vB you're running...

3.6.1

G0F0RBR0KE 11-12-2006 05:34 AM

not good >.> I'm on 3.5.4 and there is NO way for me to implement this till I upgrade my software (I have no attention in upgrading since they don't have ushop and ucash for that version)...Don't give up hope...I might see if my friend allows me to test stuff on his forum... :confused:

aveon 11-12-2006 05:41 AM

Quote:

Originally Posted by EvilAkuma
not good >.> I'm on 3.5.4 and there is NO way for me to implement this till I upgrade my software (I have no attention in upgrading since they don't have ushop and ucash for that version)...Don't give up hope...I might see if my friend allows me to test stuff on his forum... :confused:


like i said before just get a free domain and install vbulletin to it and test ur staff on that free site its better and clear

G0F0RBR0KE 11-12-2006 05:43 AM

You're running 3.6.x I'm running 3.5.x
You do realize I was planning to test it as a xml product...But i'll see if I can test it on my friends forum...I doubt he'll do it on a free domain..

aveon 11-12-2006 05:46 AM

actuallt i do have a free domain you can install vbuletin on it for ur test site there you lo ill give you the login by pm

G0F0RBR0KE 11-12-2006 05:51 AM

I dont have vB 3.6.x and my friend wont allow me to have his to test stuff


All times are GMT. The time now is 02:53 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.01955 seconds
  • Memory Usage 1,756KB
  • 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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