#################################################################
## Mod Title: Registration IP Logger
## Version: 1.0
## Author: oc5iD
## Email:
admin@on-irc.net
## Support:
http://www.on-irc.net
##
## Description: This will log a users IP when they register.
## From the admin panel, you can search for a user
## you will be displayed with the username you
## searched for, the IP they registered at, their
## email address and any other username's that
## registered from that IP address. From the
## admin users list, you can see at a glance
## all the users IP's upon registering.
##
## Installation Level: Easy
##
## Installation Time: 5 Minutes
##
## Files To Edit: includes/usercp_register.php
## /admin/admin_user_list.php
## /templates/xxx/admin/admin_users_list_body.tpl
##
## Included Files: /install/reg_ip_db_update.php
## /install/reg_ip_db_update.sql
## templates/xxx/admin/user_ip_list.tpl
## admin/admin_reg_ip.php
##
#################################################################
## Author Notes:
##
## As with all mods, Please backup your files before adding any mod.
##
## Please DO NOT pm, email or add me to MSN regarding mod requests.
## If you have any problems or have any requests, then please use
## our support forums.
#################################################################
##
## HISTORY:
##
## v1.0 17/01/05 Public Release
##
#################################################################
#
#-----[ SQL / RUN ]---------------------------
#
Upload the install folder to your phpBB. Then run the following file:
http://www.your-domain.com/xxx/install/ ... update.php
xxx = your forum folder
Or you can run the command manually in phpmyadmin:
ALTER TABLE phpbb_users ADD user_reg_ip TEXT NULL, ADD user_reg_host TEXT NULL;
#
#-----[ COPY ]---------------------------
#
templates/xxxx/admin/user_ip_list.tpl
#
#-----[ COPY ]---------------------------
#
admin/admin_reg_ip.php
#
#-----[ OPEN ]------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
$user_id = $row['total'] + 1;
#
#-----[ AFTER ADD ]---------
#
//
// oc5iD Reg IP logger
//
if (isSet($_SERVER))
{
if (isSet($_SERVER["HTTP_X_FORWARDED_FOR"]))
{
$realip = $_SERVER["HTTP_X_FORWARDED_FOR"];
}
elseif (isSet($_SERVER["HTTP_CLIENT_IP"]))
{
$realip = $_SERVER["HTTP_CLIENT_IP"];
}
else
{
$realip = $_SERVER["REMOTE_ADDR"];
}
}
else
{
if ( getenv( 'HTTP_X_FORWARDED_FOR' ) )
{
$realip = getenv( 'HTTP_X_FORWARDED_FOR' );
}
elseif ( getenv( 'HTTP_CLIENT_IP' ) )
{
$realip = getenv( 'HTTP_CLIENT_IP' );
}
else
{
$realip = getenv( 'REMOTE_ADDR' );
}
}
$user_reg_id = $realip;
$user_reg_host = gethostbyaddr($realip);
//
// END oc5iD Reg IP logger
//
#
#-----[ FIND ]--------------------
#
$sql = "INSERT INTO " . USERS_TABLE . " (
#
#-----[ IN-LINE AFTER ADD ]------------------------------------------
#
user_reg_ip, user_reg_host,
#
#-----[ FIND (next line down) ]------------------------------------
#
VALUES (
#
#-----[ IN-LINE AFTER ADD ]------------------------------
#
'" . str_replace("\'", "''", $user_reg_id) . "', '" . str_replace("\'", "''", $user_reg_host) . "',
#
#-----[ SAVE/CLOSE ]------------------------------------------
#
open /admin/users_list.php
#
#-----[ FIND ]--------------------
#
// Query users info...
$sql = "SELECT user_id, username,
#
#-----[ AFTER ADD ]--------------------
#
user_reg_ip,
#
#-----[ FIND ]--------------------
#
'USERNAME' => $userrow[$i]['username'],
#
#-----[ AFTER ADD ]--------------------
#
'REG_IP' => $userrow[$i]['user_reg_ip'],
#
#-----[ SAVE/CLOSE ]------------------------------------------
#
OPEN: templates/xxx/admin/admin_users_list_body.tpl
#
#-----[ FIND ]--------------------
#
<th class="thTop" height="25" valign="middle" nowrap="nowrap">Username</th>
#
#-----[ AFTER ADD ]--------------------
#
<th class="thTop" height="25" valign="middle" nowrap="nowrap">Reg IP</th>
#
#-----[ FIND ]--------------------
#
<td class="{userrow.COLOR}" align="center" valign="middle" height="28" nowrap="nowrap"><span class="genmed">{userrow.USERNAME}</span></td>
#
#-----[ AFTER ADD ]--------------------
#
<td class="{userrow.COLOR}" align="center" valign="middle" height="28" nowrap="nowrap"><span class="genmed">{userrow.REG_IP}</span></td>
#
#-----[ FIND ]--------------------
#
<!-- END userrow -->
<tr>
<td class="cat" height="28" align="center" valign="middle" colspan="8">
#
#-----[ REPLACE WITH ]--------------------
#
<!-- END userrow -->
<tr>
<td class="cat" height="28" align="center" valign="middle" colspan="9">
#
#-----[ SAVE/CLOSE ]------------------------------------------
#
#
#-----[ END: UPLOAD YOUR MODDED FILES ]--------------------
#
## For support and problems, please use our support forum @
http://www.on-irc.net