1
grega1
Hack needed to capture IP address in MySQL during registration
  • 2006/3/23 5:51

  • grega1

  • Just popping in

  • Posts: 15

  • Since: 2005/1/6 1


I need some help hacking XOOPS so that it will capture a new user's IP address in the MySQL database in the Xoops_User table during the registration process.

It is necessary to capture the users IP address along with timestamp, and opt-in acceptance to comply with the Can Spam Act for doing e-mailings to users.

Can anyone offer assistance?

Regards,
Greg

2
peterr
Re: Hack needed to capture IP address in MySQL during registration
  • 2006/3/23 11:41

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Looking at the session table as an example, for the IP address

1. Add this field to the users table

Quote:

user_sess_ip varchar(15) NOT NULL default '';


2. Find out where a new row is added to the users table, and then add the appropriate column name

Quote:

user_sess_ip


.. and column value

Quote:

$_SERVER['REMOTE_ADDR']


It looks like you need to find this line in register.php for the insert code

$newuser->setVar('user_mailok',$user_mailoktrue);


and add a line after it, something like ...

$newuser->setVar('user_sess_ip',$_SERVER['REMOTE_ADDR'], true);


That's just a wild guess though, but I hope it get's you started.

P
NO to the Microsoft Office format as an ISO standard.
Sign the petition

Login

Who's Online

148 user(s) are online (82 user(s) are browsing Support Forums)


Members: 0


Guests: 148


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits