tamriel-foundry / apocrypha

Theme files for Tamriel Foundry
2 stars 1 forks source link

Store User IP at Registration #14

Closed aaclayton closed 10 years ago

aaclayton commented 11 years ago

We need to start saving the IP address of new accounts at the time they first register as a usermeta entry. At the moment, we just save the IP of users when they post something, but saving this at the point of registration would allow us to leverage IP detection against undesirables BEFORE they are able to post.

aaclayton commented 11 years ago

OK, I definitely think this is a MUST have for the redesign. I want us to crack down on multiple registrations, so I would like to have the registration system generate an automated email to the admin account whenever anyone registers a new user account with a duplicate IP address.

In fact, I think it's important to figure out a way to "back-fill" primary IP addresses for existing TF users. One possible strategy for doing this is...when I generate the "author block" for any user on a forum post or reply, I'm pulling all of that user's meta information already from the database, so once I have all those records, I could check to see if a "registration_ip" meta-key exists. If the key doesn't already exist, I can just pull the IP address from that user's most recent post and save it. This would cause a small performance hit in the short term, while the IP addresses of people get back-filled, HOWEVER the slowdown would exponentially decrease as more and more users actually have IP addresses in usermeta. Eventually I could remove this code entirely.

aaclayton commented 10 years ago

I think I'll try tackling user registration soon, I'll just need to hook into BuddyPress' registration handling and save a usermeta from the $_SERVER global.

aaclayton commented 10 years ago

All done!