Log IP Address on Registration

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
112
78%
Very Good
16
11%
Good
8
6%
Fair
3
2%
Poor
4
3%
 
Total votes: 143

reubanater
Registered User
Posts: 8
Joined: Wed Nov 28, 2007 3:11 pm

Re: Log IP Address on Registration

Post by reubanater »

I have installed what you have contributed to the forum. I do have to say this will be helpful. However it's not what I had in mind but close.

When I activate someone's account who has registered I review what has been entered. What would be nice is that this mod that puts the IP address in their Registration information would be linkable to the search results found with the IP Search Mod by Thoul.

So when I am reviewing the information all I have to do is click on the Registration IP address and that will take me to the Search By IP Address results without having to copy the IP address, Click on the IP Search, Then paste the IP, Then Submit, Then get results. This could eliminate a bunch of steps and make the process much quicker.

The same process could be done with the already function of the built in IP results from when someone post a topic. You know when you click on the "IP" button then it gives you a list of users who are posting from this IP and all of the other IP address they have posted from. I don't know which would be easier to code since this method would not require anyone to have the "IP Search" mod installed. And you could use the "IP Image" beside the Registration IP Address to bring up these reuslts.

I hope I have made myself more clear now. I wish I knew how to code PHP but I hardly know anything about it and stumble around trying to make these cool mods work on my site. Thanks again for responding and sharing these other additions however, they will be helpful:!:

User avatar
EverettB
Registered User
Posts: 326
Joined: Fri Aug 01, 2003 7:11 pm
Location: North America

Re: Log IP Address on Registration

Post by EverettB »

Got it, that's a good idea, I need that too. I think this is what you want:
I changed the static IP text in the user admin screen to be a link to the admin_ip_search page.

In admin_users.php
FIND

Code: Select all

		$user_regip = decode_ip($this_userdata['user_regip']);
REPLACE WITH

Code: Select all

		$user_regip = decode_ip($this_userdata['user_regip']);
		$user_regip = '<a href="' . append_sid("admin_ip_search.php?submit=Submit&ip=" . $user_regip) . '">' . $user_regip . '</a>';

reubanater
Registered User
Posts: 8
Joined: Wed Nov 28, 2007 3:11 pm

Re: Log IP Address on Registration

Post by reubanater »

EverettB wrote:Got it, that's a good idea, I need that too. I think this is what you want:
I changed the static IP text in the user admin screen to be a link to the admin_ip_search page.

In admin_users.php
FIND

Code: Select all

		$user_regip = decode_ip($this_userdata['user_regip']);
REPLACE WITH

Code: Select all

		$user_regip = decode_ip($this_userdata['user_regip']);
		$user_regip = '<a href="' . append_sid("admin_ip_search.php?submit=Submit&ip=" . $user_regip) . '">' . $user_regip . '</a>';
Dude, You are so Awesome!! That is what I meant and wanted. Thank You so Much!! Now I can rest easier when I ban a member and now will have a better idea that this might be them trying to gain access again.

Thanks A Bunch!!

pescadero
Registered User
Posts: 24
Joined: Wed Apr 16, 2008 11:17 pm

SQL Error : 1110 Column 'user_regip' specifried twice

Post by pescadero »

I am getting the following error when a new user tries to register:

Code: Select all

SQL Error : 1110 Column 'user_regip' specified twice
I've installed the reg_ip mod with EasyMod and I had problems when running it due to a permissions issue. The permissions issue did not appear until stage 3 of the install, after stages 1 and 2 had successfully completed. To complete the install, I fixed the permissions problem and re-ran EasyMod. It looks like Stages 1 and 2 got performed twice, and Stage 3 got performed once. It looks like the 'user_regip' column exists twice in my database because Stage 2 (the SQL creation stage) was executed twice.

Can you recommend a way to fix the problem? I don't know beans about MySQL.

Thanks.
Last edited by pescadero on Wed Jun 18, 2008 7:30 pm, edited 1 time in total.

pescadero
Registered User
Posts: 24
Joined: Wed Apr 16, 2008 11:17 pm

Re: Log IP Address on Registration

Post by pescadero »

from one of my users:
I tried re-registering ...

Code: Select all

Could not insert data into users table

DEBUG MODE

SQL Error : 1110 Column 'user_regip' specified twice

INSERT INTO phpbb_IRPusers (user_id, username, user_regdate, user_password, user_email, user_regip, user_regip,user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_show_quickreply, user_quickreply_mode, user_open_quickreply,user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) VALUES (10, 'Buell', 1213742241, '15d225936903c7484c83046c50ddf381', 'Fuppets@yahoo.com', '62c17b14', '62c17b14', '', '', '', '', '', '', '', '', 0, 0, '', '', '', 1, 1, 1, 1, 1, 0, 1, 1, -6, 'D M d, Y g:i a', 1, 1, 1,'english', 1, 0, 1, 1, '')

Line : 651
File : usercp_register.php

User avatar
Jim_UK
Former Team Member
Posts: 18478
Joined: Tue Oct 12, 2004 5:36 pm
Location: Darwen N.West UK

Re: Log IP Address on Registration

Post by Jim_UK »

Clearly because it is there twice
INSERT INTO phpbb_IRPusers (user_id, username, user_regdate, user_password, user_email, user_regip, user_regip,user_icq, user_website, user_occ, user_from,
The error is nothing to do with a database problem but relates to an error you have made when editing a file. You have added the field twice. Go back over the mod and see which file called for that field to be added. Remove one instance.

Probably this one
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
# this is only a partial match
#
$sql = "INSERT INTO " . USERS_TABLE . "
#
#-----[ IN-LINE FIND ]---------------------------------
#
user_icq,
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------
#
user_regip,
Jim
The truth is out there.
Unfortunately they will not let you anywhere near it!

pescadero
Registered User
Posts: 24
Joined: Wed Apr 16, 2008 11:17 pm

Re: Log IP Address on Registration

Post by pescadero »

Thanks for your help, Jim. I have removed the duplicate entry in the line that you referenced.

Just to clarify things --

1. That error quoted above is not an error that occurs during mod installation. Its a user error that occurs when registering on the board. I'm not sure whether I made that clear or not.

2. I didn't manually edit any files in doing the install, I used Easy Mod. That was done a long time ago, and the Mod successfully completed its installation when the installation was run the second time. EasyMod did show that the SQL entries were created in the table each time that the Mod install was attempted.

I am concerned that there already exist duplicate column entries for the 'user_ip' field in the database. I'm not sure that editing one of the text files would correct the problem. I'm thinking that the SQL table should be modified in order to fix the problem by removing the superfluous column.

Or am I really missing something?

I would like some SQL help so that I can look at the database to see if an extra column exists there, and then take the necessary steps to delete it.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51987
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Log IP Address on Registration

Post by Brf »

As your error msessage states:
File : usercp_register.php
the error is in usercp_register.php. It is trying to insert the same solumn twice in one statement.

User avatar
Jim_UK
Former Team Member
Posts: 18478
Joined: Tue Oct 12, 2004 5:36 pm
Location: Darwen N.West UK

Re: Log IP Address on Registration

Post by Jim_UK »

1. That error quoted above is not an error that occurs during mod installation. Its a user error that occurs when registering on the board. I'm not sure whether I made that clear or not.
The error occurs when a user tries to register but it is due to an error that you made in the installing of the mod. You added two instances of the field into that line instead of one.

The change to the database was made when you ran this query
ALTER TABLE phpbb_users ADD user_regip CHAR(8) NOT NULL DEFAULT '0';
There will only be one instance of that field in the database.

Easy to test is it not?
Just do a registration to your board and see what happens.

Jim
The truth is out there.
Unfortunately they will not let you anywhere near it!

pescadero
Registered User
Posts: 24
Joined: Wed Apr 16, 2008 11:17 pm

Re: Log IP Address on Registration

Post by pescadero »

Jim_UK wrote:The change to the database was made when you ran this query
ALTER TABLE phpbb_users ADD user_regip CHAR(8) NOT NULL DEFAULT '0';
There will only be one instance of that field in the database.
That query is executed in Stage 2 of the EasyMod installation. Because Stage 2 was successfully completed twice, that query was executed twice. I am expecting that there should be two instances of that column in the database, but I don't know SQL so I can't verify my expectations.
Jim_UK wrote:Easy to test is it not?
Just do a registration to your board and see what happens.

already done:

Code: Select all

Could not insert data into users table

DEBUG MODE

SQL Error : 1136 Column count doesn't match value count at row 1

INSERT INTO phpbb_IRPusers (user_id, username, user_regdate, user_password, user_email, user_regip, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_show_quickreply, user_quickreply_mode, user_open_quickreply,user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) VALUES (10, 'petco', 1213819906, 'eaa7c76eb79bfeb377bcd3be8b645e75', 'xxxxxxxx@xxxxxxx', '0a0a0a6a', '0a0a0a6a', '', '', '', '', '', '', '', '', 0, 0, '', '', '', 1, 1, 1, 1, 1, 0, 1, 1, 0, 'D M d, Y g:i a', 1, 1, 1,'english', 1, 0, 1, 1, '')

Line : 651
File : usercp_register.php
Last edited by pescadero on Wed Jun 18, 2008 9:51 pm, edited 1 time in total.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51987
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Log IP Address on Registration

Post by Brf »

pescadero wrote: That query is executed in Stage 2 of the EasyMod installation. Because Stage 2 was successfully completed twice, that query was executed twice. I am expecting that there should be two instances of that column in the database,
No. SQL will not let you have duplicate columns, so it will only be in the database once.
On the other hand, when Easymod inserted the text in to usercp_register.php, it inserted it twice.

TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Re: Log IP Address on Registration

Post by TerraFrost »

There are two parts of an insert - the part where the columns being inserted are named (eg. INSERT INTO phpbb_users (column_name1, column_name2, etc)) and the part where the values are defined. You removed user_regip from the former but not from the latter. eg.
INSERT INTO phpbb_IRPusers (user_id, username, user_regdate, user_password, user_email, user_regip, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_show_quickreply, user_quickreply_mode, user_open_quickreply,user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) VALUES (10, 'petco', 1213819906, 'eaa7c76eb79bfeb377bcd3be8b645e75', 'redacted', '0a0a0a6a', '0a0a0a6a', '', '', '', '', '', '', '', '', 0, 0, '', '', '', 1, 1, 1, 1, 1, 0, 1, 1, 0, 'D M d, Y g:i a', 1, 1, 1,'english', 1, 0, 1, 1, '')

T12VNG
Registered User
Posts: 15
Joined: Fri Jul 04, 2008 10:12 am

Re: Log IP Address on Registration

Post by T12VNG »

I have installed this update but have tried to register a test member & I get this error:

Could not insert data into users table

DEBUG MODE

SQL Error : 1054 Unknown column 'user_regip' in 'field list'

INSERT INTO phpbb_users (user_id, username, user_regdate, user_password, user_email, user_regip, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) VALUES (198, 'd9234aaf', 'test', 1215165608, '098f6bcd4621d373cade4e832627b4f6', 'retro-tones@hotmail.co.uk', '', '', '', '', '', '', '', '', 0, 0, '', '', '', 1, 1, 1, 1, 1, 0, 1, 1, 1, 'D M d, Y g:i a', 'english', 1, 0, 1, 0, '545f61')

Line : 647
File : usercp_register.php


Can anyone let me know what I've done wrong please?
Or how I can rectify this problem please?

Cheers
Tony

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21035
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Log IP Address on Registration

Post by RMcGirr83 »

You didn't do the sql update on the database.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

T12VNG
Registered User
Posts: 15
Joined: Fri Jul 04, 2008 10:12 am

Re: Log IP Address on Registration

Post by T12VNG »

by RMcGirr83 on Fri Jul 04, 2008 11:47 am
You didn't do the sql update on the database.
Rich McGirr
Ok, thanks.

How do I do that then? I'm pretty new to all this..... :oops:

Post Reply

Return to “[2.0.x] MOD Database Releases”