The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Regarding this thread :
http://www.vbulletin.com/forum/showthread.php?t=312600 Im trying to find a quick easy way to record a users name & ip address when they visit the forums, any ideas and suggestions from the community ? My own thought was just to put a hook on the forumdisplay page to update the "ipaddress" in the "user" table, but not sure what impact this will have. |
#2
|
||||
|
||||
![]()
You are making the assumption that a user will first login to the forums prior to the game server? Is that always true? Personally, I'd do something with the server iptables to block ips that pound the server. Or, I'd talk to the host about different methods available to combat a dos attack.
|
#3
|
||||
|
||||
![]() Quote:
Our host will provide DDOS protection.... for $1,000 a month - so thats a non starter We frequently run a PHP script to scan the apache access_log, find anything that has requested the same "GET" in a short time then add it to the IPTABLES list - this is working and catching about 80-90% of the ddos but its a task we have to run every few hours as and when new zombies power up All players have been told if they are on DHCP they will need to browse the forums before they can loginto the game to ensure their IP is authorised, and they are happy with this if it will reduce the LAG of the current packet filter ![]() |
#4
|
||||
|
||||
![]()
Well, I can tell you that the IP in the user table is just the registration IP. If I were to try what you are doing, I'd create a new field called something like "current_ip" and put the current ip addy in there and use that instead of replacing the registration ip. As soon as a user logs into the site, I'd grab the ip and put it in the field.
|
#5
|
||||
|
||||
![]()
Any pointers on how to do this ? I did some plugins a long time ago and cant really remember that much
![]() Ive created a custom user field, found it in the vb database structure. Just need to know the best way to update a userfield as a plugin. I bet its really easy one liner, something simple like $vbulletin->setsomething..... |
#6
|
||||
|
||||
![]()
Actually, it isn't just a one-liner. You need to add it to the datamanager array for the user (one of the class_dm_ files contains the array) and then you need to set the variable wherever it is that you grab the ip.
|
#7
|
||||
|
||||
![]()
So I guess this is really bad, sloppy poor coding then
but for a 1st draft it works, sure it wont detect a proxy but its a start ![]() Code:
// test $uid=$vbulletin->userinfo['userid']; if ($uid > 0) { $query="UPDATE userfield SET field5='" . $_SERVER['REMOTE_ADDR'] . "' WHERE userid=$uid"; mysql_query($query); } |
#8
|
||||
|
||||
![]()
I suppose you could do it that way. It isn't as clean as using the vbulletin datamanagers, but I suppose it will work.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|