Collect IP Addresses at Registration (Technics)

by Wendell, Saturday, April 16, 2011, 16:50 (4756 days ago)

I personally research every spammy-looking email address that is registered in my forum. When I find one that is a spammer, I lock that account. However, since the IP address is not collected during registration, I cannot add it to the block IP list. How can I collect these IPs? I would be satisfied if it were just included in the notification to me via email when a new user registers, but keeping it in the database would be even better. :)

Any ideas?

BTW: I'd be happy to pay someone to set this up for me.

Avatar

Collect IP Addresses at Registration

by Micha ⌂, Monday, April 18, 2011, 15:30 (4754 days ago) @ Wendell

Hi,

I don't validate the following changes!!!


Open the includes/register.inc.php line 184ff and replace with:

if($settings['register_mode']==1) $new_user_notif_txt = $lang['new_user_notif_txt_locked'];
         else $new_user_notif_txt = $lang['new_user_notif_txt'];
         $new_user_notif_txt = str_replace("[name]", $data['user_name'], $new_user_notif_txt);
         $new_user_notif_txt = str_replace("[email]", $data['user_email'], $new_user_notif_txt);
         $new_user_notif_txt = str_replace("[ip]", htmlspecialchars($_SERVER["REMOTE_ADDR"]), $new_user_notif_txt);
         $new_user_notif_txt = str_replace("[user_link]", $settings['forum_address']."index.php?mode=user&show_user=".$id, $new_user_notif_txt);

The new Line is:

$new_user_notif_txt = str_replace("[ip]", htmlspecialchars($_SERVER["REMOTE_ADDR"]), $new_user_notif_txt);

Additional, you have to add the keyword [ip] to your lang-Files.

Look for new_user_notif_txt and new_user_notif_txt_locked, respectively and add this keyword e.g.:

new_user_notif_txt_locked =       """Hi [recipient],
a new user has subscribed to the forum.
User name: [name]
E-mail: [email]
User-Ip: [ip]
...

Hope it works...

regards Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

RSS Feed of thread