Log in

View Full Version : Mini Mods - Multiple Registrations with the same IP (Basic)


Sinan COSKUN
04-21-2020, 09:00 PM
Hello to everyone.
With the code snippet below, you can prevent registration with the same IP within 1 hour.
If you have a limited download site, it might work for you.


1 - Logon to your AdminCP
2 - Goto Plugins & Products -> Add New Plugin

a- Products : Vbulletin
b- Hook: register_start
c- Title: IP Block
d- ord app: 5
e- PHP Code:


global $db, $vbulletin;

$user_ip = strtoupper($_SERVER['REMOTE_ADDR']);

$rcek= $db->query("SELECT * FROM " .TABLE_PREFIX."user WHERE ipaddress = '".$user_ip."' AND lastactivity >= unix_timestamp(CURRENT_TIMESTAMP - INTERVAL 60 MINUTE)");
$result = $db->num_rows($rcek);


if($result !== 0){
echo '<meta http-equiv="refresh" content="3;URL=YOUR_SITE_URL" /> ';
}

djbaxter
04-22-2020, 01:21 PM
Just one caution: with more and more people using tablets and smart phones (well maybe not smart phones with vB4), the registration IP will be that of the mobile carrier so I'm finding that many members have the same IP.