1
icepick66
Ban cookie?
  • 2007/6/24 15:21

  • icepick66

  • Just popping in

  • Posts: 20

  • Since: 2004/9/25


Is there any hack or feature to give banned users a ban cookie, so if they change ip address it will still block them from being able to access the site?

Simular to IPB's ban cookie feature.

2
versuri32
Re: Ban cookie?
  • 2007/6/27 8:45

  • versuri32

  • Just popping in

  • Posts: 4

  • Since: 2007/6/27


Never heared about that

3
icepick66
Re: Ban cookie?
  • 2007/7/26 13:12

  • icepick66

  • Just popping in

  • Posts: 20

  • Since: 2004/9/25


In the end i found a old phpbb ban cookie addon and patched it into protector:

Heres how I did it:

Protector Trust Path/include/pre_check.php
le="color: #000000"><?php function protector_prepare() { // FIND // // check the access is from install/index.php if( defined( '_INSTALL_CHARSET' ) ) die( 'To use installer, remove protector's lines from mainfile.php first.' ) ; // Protector class require_once dirname(dirname(__FILE__)).'/class/protector.php' ; // add Below // if (isset($_COOKIE["xoops_banned"])) { // Set the banned cookie for a year, reset it every time the user visits. (Thanks to Merlin Sythove) setcookie( "xoops_banned", true, time() + (365 * 24 * 3600), "/", "yourdomainname.co.uk", "0" ); die('You are banned'); } // FIND// // bad_ips $bad_ips = Protector::get_bad_ips() ; foreach( $bad_ips as $bad_ip ) { if( $bad_ip && substr( @$_SERVER['REMOTE_ADDR'] , 0 , strlen( $bad_ip ) ) == $bad_ip ) { // ADD line// setcookie( "xoops_banned", true, time() + (365 * 24 * 3600), "/", "yourdomainname.co.uk", "0" ); die( 'You are registered as BAD_IP by Protector.' ) ; } }


I advise you change the cookie name "xoops_banned" to match your site's name or somthing.

Obviously this wont stop the advance moron, but stop morons with dynamic ip's for long enough they will give up.

Hopefully someone will make a account banning system so when a banned user trys to log into his account, he is automatically banned by a cookie or IP

Login

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits