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 07-30-2006 01:16 AM

Cookie Ban ??
 
hello mates

im looking for a mod well this mod will put a cookie on someones computer if they are banned via IP and try to access the forum. It then will check for that cookie every time they try to access the forum, and will block them. If there is something like this it would be most usefull for keeping people with dynamic IPs out.???????

it would be great if anyone can help me :(

aveon 07-31-2006 01:55 AM

i figured ou something like this and i dont know how to install this to vbulletin...


HTML Code:

<?php
$IP = $_SERVER['REMOTE_ADDR'];
if ($IP =="x.x.x.x")
setcookie(Ban, 'cookietest', time()+3600000000);
else if ($IP =="x.x.x.x")
setcookie(Ban, 'cookietest', time()+3600000000);
else if ($IP =="x.x.x.x")
setcookie(Ban, 'cookietest', time()+3600000000);
else if ($IP =="x.x.x.x")
setcookie(Ban, 'cookietest', time()+3600000000);
else if ($IP =="x.x.x.x")
setcookie(Ban, 'cookietest', time()+3600000000);
else if ($IP =="x.x.x.x")
setcookie(Ban, 'cookietest', time()+3600000000);
else if ($IP =="x.x.x.x")
setcookie(Ban, 'cookietest', time()+3600000000);
else echo "";
?>

<?php
if ($_COOKIE['Ban'])
die ('Sorry, you are banned from using this forum!');
else echo "";
?>


aveon 08-03-2006 04:08 AM

this would be a great hack if you guys help me to finish this and i know it will be use full to other vb users

harmor19 08-03-2006 05:02 AM

Why would you do it that way?
A better solution would giving the user a cookie then check if the user has the cookie

PHP Code:

<?php
setcookie
(Ban'cookietest'time()+3600000000);
?>

Then you'd just check if user has the cookie
PHP Code:

<?php
if (isset($_COOKIE['Ban']))
{
   die(
"You are banned from using this forum");
}
?>


aveon 08-03-2006 08:07 AM

where do i add this codes how do i creae a coockie i dont have any idea can you help me out with that???

aveon 08-07-2006 05:00 AM

anybody to help me any body good on cookies ?????

fxs158 08-07-2006 11:04 AM

This is actually a good idea, but as the original poster said, the ideal thing would be to send two cookies. One with the forum name etc and the seccond with a name that we would choose.

That way if user tries to delete cookie, more than likelly he is not going to delete all becaue it is a pain in the rear, he would then look for the cookie and delete the one with the domain name and call it the day.

Not knowing that there is a seccond cookie.

Better yet, is there a way to set a cookie that would record the mac adress of the user?

I be willing to pay $$ for a good security hack like this.

aveon 08-07-2006 01:20 PM

i just need to kno how to set cookies and send them to the users how do i do that my question is easy is that...???

Dilmah 08-07-2006 02:20 PM

Mac addresses are useless.

aveon 08-08-2006 01:37 AM

i found this on web and this hack is for invidionize boards but can we use it for vbulletin too??


Quote:

2. Open up functions.php

3. Find:

----------------------------------------------------------

if ($ibforums->vars['ban_ip'])

{

$ips = explode( "|", $ibforums->vars['ban_ip'] );



foreach ($ips as $ip)

----------------------------------------------------------

4. Before add:

----------------------------------------------------------

// Check to see if the banned cookie is set

if ($std->my_getcookie('banned')) {

$std->Error( array( 'LEVEL' => 1, 'MSG' => 'you_are_banned', 'INIT' => 1 ) );

}

----------------------------------------------------------

5. Find:

----------------------------------------------------------

$ip = preg_replace( "/\*/", '.*' , preg_quote($ip, "/") );



if ( preg_match( "/^$ip/", $ibforums->input['IP_ADDRESS'] ) )

{

----------------------------------------------------------

6. Below add:

----------------------------------------------------------

if(!$std->my_getcookie('banned')) {

$std->my_setcookie('banned', 'yes');

}

----------------------------------------------------------
with all this information cant we figure out anything at all???


All times are GMT. The time now is 09:26 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.02580 seconds
  • Memory Usage 1,740KB
  • 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)bbcode_html_printable
  • (2)bbcode_php_printable
  • (1)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
  • (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