Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #31  
Old 11-12-2006, 04:35 AM
aveon's Avatar
aveon aveon is offline
 
Join Date: May 2006
Posts: 410
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #32  
Old 11-12-2006, 05:02 AM
G0F0RBR0KE G0F0RBR0KE is offline
 
Join Date: Mar 2005
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alrite...I'll see if I can get it transfer to vBulletin... I'll try my best...
Reply With Quote
  #33  
Old 11-12-2006, 05:04 AM
aveon's Avatar
aveon aveon is offline
 
Join Date: May 2006
Posts: 410
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #34  
Old 11-12-2006, 05:20 AM
G0F0RBR0KE G0F0RBR0KE is offline
 
Join Date: Mar 2005
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Before I decide to start on it..please tell me what version vB you're running...
Reply With Quote
  #35  
Old 11-12-2006, 05:26 AM
aveon's Avatar
aveon aveon is offline
 
Join Date: May 2006
Posts: 410
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by EvilAkuma
Before I decide to start on it..please tell me what version vB you're running...
3.6.1
Reply With Quote
  #36  
Old 11-12-2006, 05:34 AM
G0F0RBR0KE G0F0RBR0KE is offline
 
Join Date: Mar 2005
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #37  
Old 11-12-2006, 05:41 AM
aveon's Avatar
aveon aveon is offline
 
Join Date: May 2006
Posts: 410
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...

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
Reply With Quote
  #38  
Old 11-12-2006, 05:43 AM
G0F0RBR0KE G0F0RBR0KE is offline
 
Join Date: Mar 2005
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #39  
Old 11-12-2006, 05:46 AM
aveon's Avatar
aveon aveon is offline
 
Join Date: May 2006
Posts: 410
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #40  
Old 11-12-2006, 05:51 AM
G0F0RBR0KE G0F0RBR0KE is offline
 
Join Date: Mar 2005
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thread Tools
Display Modes

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 08:25 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07361 seconds
  • Memory Usage 2,254KB
  • Queries Executed 11 (?)
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
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete