forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: mrshs on November 28, 2010, 02:46:11 pm

Title: Getting user-IPs?
Post by: mrshs on November 28, 2010, 02:46:11 pm
Hello everyone!

Is there a way to find out what an IP a user has, without him/her having posted a comment? We have serious troubles with a user at our gallery. Deleting his account doesn't help as he can register again, and again. So, what we would need is a way, to see the IP of a member right after he registered, so we can look the IP up, before we approve his registration.

Is there a WAY to find out from what IP the person did register? I looked everywhere but can't find such a feature.


Thanks in advance!
Title: Re: Getting user-IPs?
Post by: Αndré on November 28, 2010, 02:59:30 pm
Did you intentionally marked your topic as solved? If not, it should be possible by adding a new field to the user database and populate it during the installation.
Title: Re: Getting user-IPs?
Post by: mrshs on November 28, 2010, 03:02:01 pm
OMG it isn't solved.. that was a mistake.. but I am afraid I can not unmark it, eh?

However, how would I add such a field? Are there any instructions? Otherwise I am afraid I can't add the field myself.
Title: Re: Getting user-IPs?
Post by: Αndré on November 28, 2010, 03:07:30 pm
I can not unmark it
You can by pressing the 'X' in the initial post. I've done that for you.


However, how would I add such a field?
Use a tool like phpMyAdmin to add the new field to the users table. If you've done that we have to modify a Coppermine file (probably register.php, but I haven't checked that yet).
Title: Re: Getting user-IPs?
Post by: mrshs on November 28, 2010, 03:17:23 pm
Oh, ok, I am at phpMyAdmin now.. but I am totally lost. I am at the cpg_users list, but what do I need to do?


Sorry that you've have to help such a PHP-loser here.


PS: Thanks for "unsolving" this topic again!  ;)
Title: Re: Getting user-IPs?
Post by: mrshs on December 08, 2010, 03:57:12 pm
Hi, can anyone tell me where I can find out how to do this? I was looking at the phpMyAdmin website, but I don't know what exactly to look around for.
Title: Re: Getting user-IPs?
Post by: Αndré on December 08, 2010, 04:11:29 pm
http://lmgtfy.com/?q=phpmyadmin+add+column
Title: Re: Getting user-IPs?
Post by: mrshs on December 08, 2010, 04:14:06 pm
Thanks Andre! I was actually looking for "how to add a field...etc".. so, I didn't find a lot.
Title: Re: Getting user-IPs?
Post by: mrshs on December 08, 2010, 04:41:37 pm
Use a tool like phpMyAdmin to add the new field to the users table. If you've done that we have to modify a Coppermine file (probably register.php, but I haven't checked that yet).

Hi you!

OK, so I've added the field in the users table. What am I going to do now with the register.php?
Title: Re: Getting user-IPs?
Post by: Αndré on December 09, 2010, 02:27:55 pm
Open register.php, find
Code: [Select]
    $sql = "INSERT INTO {$CONFIG['TABLE_USERS']} (user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_profile1, user_profile2, user_profile3, user_profile4, user_profile5, user_profile6, user_language) VALUES (NOW(), '$active', '$act_key', '$user_name', '$encpassword', '$email', '$profile1', '$profile2', '$profile3', '$profile4', '$profile5', '$profile6', '$user_language')";and replace with
Code: [Select]
    global $raw_ip;
    $sql = "INSERT INTO {$CONFIG['TABLE_USERS']} (user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_profile1, user_profile2, user_profile3, user_profile4, user_profile5, user_profile6, user_language, ip_address) VALUES (NOW(), '$active', '$act_key', '$user_name', '$encpassword', '$email', '$profile1', '$profile2', '$profile3', '$profile4', '$profile5', '$profile6', '$user_language', '$raw_ip')";

Don't forget to adjust 'ip_address' to the name of your created column.
Title: Re: Getting user-IPs?
Post by: mrshs on December 09, 2010, 09:00:56 pm
Hi André!

thanks for your answer...

I did what you said, adjusted the columns name, but when I try to register a new test account, and look up the profile/account of the test-user, I see now IP address... also no field for it... :(
Title: Re: Getting user-IPs?
Post by: Αndré on December 10, 2010, 11:55:46 am
look up the profile/account of the test-user
Where exactly do you want the IP being displayed? Please post a link for better clarification (even I cannot access it).