Log IP on registration

is it possible to log ip on registration?

im getting more and more spammers creating splogs and when i try finidng there ip it does not exist in there profile (only ip is recorded on comments)

would it be possible for a plugin (or bit of code) (or manual instructions on how to) make it log an ip when a blog is created so when i go to ban i can ban by ip.

  • Luke
    • The Crimson Coder

    That would be a pretty nice feature, really. Although I think there is/was something for that already.

    Wait, no I think that tied into a blacklist.

    The bad thing about blocking ip’s though, is ip’s can change, and it is (in theory) possible that you could end up blocking an ip that was spoofed and might be legitimate shortly down the road.

    Have you considered trying bad behavior? It’s worked wonders for me so far.

  • drmike
    • DEV MAN’s Mascot

    I’ve brought it up on trac a long while back and once on the forums a few weeks ago. The current system does log the IP address within the database but doesn’t display it anywhere.

    edit: It’s in the table wp_registration_log. I thought it was elsewhere as well but I don’t see it.

  • Luke
    • The Crimson Coder

    A simple join to get some additional info, since the blog_id is in that table as well, plus a little custom goodness will fix it up.

    I got “curious”, so I’ve been playing around with this for about 15 minutes.

    Right now, without core edits, I’ve got the sign-up form redirecting to a static file (that looks about like the apache default “forbidden” page) for minimal bandwidth consumption when the remote ip is found within a banned_ip table.

    I’ll probably play around with the backside of it now, and match up ip’s and blog id’s.

    But, for the record, this does work.

    The only downside is that you can’t really deactivate the form and instead display an error message. Well, without hacking up wp-signup.php. So that’s why I went with a redirect.

  • Luke
    • The Crimson Coder

    True Doc, very true. But if I recall correctly, a lengthy htaccess file can slow up a site. Plus it isn’t super easy to change, as compared to being in a quick lookup table.

    Oh, and this could specify a block as well, if you wanted it to.