The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
Troll/ip-tracker, detect multiple accounts/trolls [3.6 compatible] Details »» | |||||||||||||||||||||||||||
Troll/ip-tracker, detect multiple accounts/trolls [3.6 compatible]
Developer Last Online: May 2019
Continuosly information about updates can also be found here.
Edit 2007-08-07 Since the script needs to be rebuilt from scratch due to some problems with it, I've decided to temporarily stop the distribution. On larger sites, this script may cause heavy lagging when active. There has also been reports on "duplicate keys", that should be fixed. To prevent more problems cause by this hack, it's removed and cannot be downloaded. History In 2005 a forum was founded, for a short period of time that was intended to work as a service for people with a common interest - a reality show. The forum grew big and the traffic was very intensive. Moderators worked day and night to assist the forum. Traffic and events in the show made people show different kind of feelings and some of them showed this in strange ways. They said "I'd better register 10 nicknames, just to secure that noone can ban me". Sometimes, when they got banned, they registered new nicks and sometimes they switched ips but they didn't post anything the same day. Next day, they switched ip again and it suddenly got much harder to trace their nicks back to the start. In 2006, the forum opened again (new season) and we was prepared for this. A script, specialized to trace trolls, was written and the main purpose was to trace things that vBulletin missed. This plugin was requested at the vBulletin forums. Now, it's here, as a beta production - a trolltracker that stamps all visitors even if they don't post anything. It also, partially, checks if an ip-address can be traced from anonymous proxies by reading headers that proxies are sending to he server (HTTP_VIA and HTTP_X_FORWARDED_FOR). Templates to change (Optional): 3 Attached trolltracker-2.0.3beta.zip - the main archive with the tracker and extras iptracker.php - A quickfix for the coming version 2.0.4 that changes the SHOW COLUMNS-behaviour-bug in the tracker The archive The zip should contain the following files
How to install
Track older ips (2.0.x) If you want to import older posts, you can do that, but because of timeouts (and bad scripting) trollpost.php may timeout if you run the script from a web-browser. This part is, currently, unsupported, but if someone has any ideas here, feel free to notify me. OPM Support The ip-tracker supports RBL Monitor. How to use it Use the tracker by calling http://your-forum.com/iptracker.php Database The installation creates a table named user_troll for your forum. The FQDN-support also adds a table called user_trollresolver for the resolver cache (like the one used in the OPM monitor) Information and issues
See CHANGELOG for full details Show the tracker in navbar (v2.0.1+) To show the tracker in the navbar (only for the admingroups that can be found in the options), edit your template 'navbar' and add this code where you want it to be shown: HTML Code:
<if condition="$show['trolltracker']"><td class="vbmenu_control"><a href="iptracker.php">Trolltracker</a></td></if> HTML Code:
<if condition="$show['member']"> <td class="vbmenu_control"><a href="login.php?$session[sessionurl]do=logout&logouthash=$bbuserinfo[logouthash]" onclick="return log_out()">$vbphrase[log_out]</a></td> </if> Edit template: whosonlinebit Find: </tr> Add above: HTML Code:
<if condition="$show['trolldata'] AND $userinfo['trolldata'] != ''"> <td class="alt1"> $userinfo[trolldata] </td> </if> WHOSONLINE Find: HTML Code:
</tr>
$onlinebits
HTML Code:
<if condition="$show['trolldata']"> <td class="thead"> <b>Trolldata</b> </td> </if> Any questions, requests and bugreports can be sent to me by PM, mail or via threads at http://vbulletin.tornevall.net/ Don't forget to install this plugin Show Your Support
|
Comments |
#52
|
||||
|
||||
Changes for 2.0.4 that will be released as soon the caches has been tested:
If someone thinks that I have forgotten something, please tell me. |
#53
|
||||
|
||||
Quote:
|
#54
|
||||||
|
||||||
After a month of use, I experienced these errors:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
I've got many more, but they are variations on the same. |
#55
|
||||
|
||||
Quote:
Yes, but blocking users is optional and can be turned off. I only block specific usernames myself but the function is there for paranoid admins Quote:
(I still cant reproduce the problem you have there with server shutdowns. If someone have a tip there, why the error shows up, I would be very happy.) |
#56
|
||||
|
||||
Ok I have found a bug:
Code:
Invalid SQL: UPDATE user_troll SET timestamp = 1156627674, date = '2006-08-26', username = 'dabear's are #1', userid = '0', time = '17:27:54', opm = '0', imported = 0 WHERE idx = '9830' AND deleted = 0 AND fqdn = 0 LIMIT 1; MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's are #1', userid = '0', time = '17:27:54', opm = '0', imported = 0 WHERE idx = ' at line 1 Error Number : 1064 Date : Saturday, August 26th 2006 @ 05:27:54 PM Script : http://www.xxxxxxx.com/forums/register.php This leaves us all open to a SQL attack.. |
#57
|
||||
|
||||
I apologize for the big delay on this hack. Too much things are happening around me so I've lost a lot of time.. Hopefully I can release 2.0.4 as soon as possible with a bunch of fixes.
As a notice - I've noticed (at least on my own server) that the function for showing trolls in the o Who's Online-listing lags me down a little bit sometimes. Probably that function depends on how many users online and how much the tracker has to look for. Without the extra cache there, I think the online-listing won't survive. Quote:
|
#58
|
||||
|
||||
Because of the apostrophe-thing, I'll release this one now.. Here's the changelog -
2.0.4 [beta]
|
#59
|
||||
|
||||
After upgrading this I get an error. I have tried uninstalling trolltracker and reinstalling it, but then I get this:
Database error in vBulletin 3.5.4: Invalid SQL: ### INSERT QUERY GENERATED BY fetch_query_sql() ### INSERT INTO vb4_plugin (`active`, `executionorder`, `title`, `hookname`, `phpcode`, `product`) VALUES ('1', '5', 'trolltracker_register', 'global_start', '// Note, this code has no version 1.0.0 released. The first version was private\r\n// and this one is the conversion.\r\n\r\n$dosavetroll = 1;\r\n\r\n// admincp settings\r\n// v1.0->2.0 and some addons\r\n$trollenabled = $vbulletin->options[\'trollenabled\'];\r\n\r\n// Something went wrong!\r\nif (!$_SERVER[\'REMOTE_ADDR\']) {$trollenabled = 0;}\r\n\r\nif ($trollenabled == 1) {\r\n$followtroll = $vbulletin->options[\'followtroll\'];\r\n$trolluseridlookup = $vbulletin->options[\'trolluserid\'];\r\n$trollunreg = $vbulletin->options[\'trollunreg\'];\r\n$trollignoreopm = $vbulletin->options[\'trollignoreopm\'];\r\n$trollwarnopm = $vbulletin->options[\'trollwarnopm\'];\r\n$trollsession = $vbulletin->options[\'trollsession\'];\r\n$trollblock = $vbulletin->options[\'trollblock\'];\r\n$trollblockuser = strtolower($vbulletin->options[\'trollblockuser\']);\r\n$trollexcludeuser = strtolower($vbulletin->options[\'trollexcludeuser\']);\r\n$trollblockusertrig = $vbulletin->options[\'trollblockusertrig\'];\r\n$trolladmin = $vbulletin->options[\'trolladmin\'];\r\n$trollcandelete = $vbulletin->options[\'trollcandelete\'];\r\n$trolluniqueheaders = $vbulletin->options[\'trolluniqueheaders\'];\r\n$trollalertuser = $vbulletin->options[\'trollalertuser\'];\r\n$trollalertforum = $vbulletin->options[\'trollalertforum\'];\r\n$trollalertafter = $vbulletin->options[\'trollalertafter\'];\r\n$trollonlineusers = $vbulletin->options[\'trollonlineusers\'];\r\n$trolldifftime = $vbulletin->options[\'trolldifftime\']*60*60;\r\n$trollalertfrom = $vbulletin->options[\'trollalertfrom\'];\r\n$trollFQDN = $vbulletin->options[\'trollFQDN\'];\r\n$trolluseFQDN = $vbulletin->options[\'trolluseFQDN\'];\r\n$trollautoblockBans = $vbulletin->options[\'trollautoblockBans\'];\r\n\r\n// Clean cacheResolver\r\n$cleanTrollResolver = TIMENOW - 21600;\r\n$vbulletin->db->query(\"DELETE FROM \" . TABLE_PREFIX . \"user_trollresolver WHERE dateline < $cleanTrollResolver\");\r\n\r\n// Who can use tracker...?\r\nglobal $istrolladmin, $istrolldelete, $vbulletin, $db, $vbphrase, $stylevar, $style;\r\n\r\n$trollgroups = explode(\',\',$vbulletin->options[trolladmin]); \r\nif (is_member_of($vbulletin->userinfo, $trollgroups)) $istrolladmin = true;\r\n\r\n// Who can manipulate the tracker?\r\n$trollcandeletegroups = explode(\',\',$vbulletin->options[trollcandelete]); \r\nif (is_member_of($vbulletin->userinfo, $trollcandeletegroups)) $istrolldelete = true;\r\n\r\nif ($istrolladmin == 1) {\r\n $show[\'trolltracker\'] = 1;\r\n if ($trollonlineusers) {$show[\'trolldata\'] = 1;}\r\n }\r\n\r\n/**** Userdata and browser stuff ****/\r\n// Reliable data to register\r\n// Note, addslashes is only needed on ONE $trollusername if we don\'t want a whole lot of dupes!\r\n$trollusername = addslashes($vbulletin->userinfo[\'username\']);\r\n$trolluserid = $vbulletin->userinfo[\'userid\'];\r\n$trollremote = $_SERVER[\'REMOTE_ADDR\'];\r\n$timestamp = TIMENOW;\r\n$trolldate = strftime(\'%Y-%m-%d\');\r\n$trolltime = strftime(\'%H:%M:%S\');\r\n\r\n\r\n// Unreliable data to save, but sometimes, still effective when trolls are using half-anonymous proxies\r\n$forwarded = $_SERVER[\'HTTP_X_FORWARDED_FOR\'];\r\n$via = $_SERVER[\'HTTP_VIA\'];\r\n\r\n// Don\'t overload the server with extra processes if not needed...\r\nif ($trollalertuser OR $trollalertforum OR $trollonlineusers == 1) {\r\n\r\n/**** COUNTING OF USER\'S NICKNAMES BEGIN (IF SELECTED FROM OPTIONS) ****/\r\n// Should only be enabled on request (alerting, blocking and \"self-notifying\")\r\n\r\n/** Check the cache for nicknames, so we don\'t have to query the big one **/\r\n// Clear old entries...\r\n$clearcachetime = TIMENOW - $vbulletin->options[cookietimeout];\r\n$vbulletin->db->query_write(\"DELETE FROM \" . TABLE_PREFIX . \"user_trollcache WHERE timestamp < \" . $clearcachetime);\r\n$trollcache = $vbulletin->db->query_first(\"SELECT * from \" . TABLE_PREFIX . \"user_trollcache WHERE realip = \'$trollremote\'\");\r\nif ($trollcache[nicks]) {\r\n $trollcachenicks = explode(\"\\n\", $trollcache[nicks]);\r\n foreach ($trollcachenicks as $nicks => $trollcachevalue) {\r\n // Must not be empty!\r\n if ($trollcachevalue) {\r\n $trollnicksUID[$vbulletin->userinfo[userid]] = $vbulletin->userinfo[userid];\r\n $trollnicksNAME[strtolower($trollcachevalue)] = strtolower($trollcachevalue);\r\n $trollnicksIP[$trollremote] = $trollremote;\r\n $trolls .= $trollcachevalue . \"\\n\";\r\n $linked++;\r\n }\r\n }\r\n}\r\n\r\n\r\n/** Check the cache for nicknames, so we don\'t have to query the big one --- DONE HERE **/\r\n// If this var is empty, we don\'t have anything cached.\r\n// Start caching only if this is no guest...\r\nif (!$trolls) {\r\n\r\n// This is a special thing that has to do with the guest vs logged when reporting.\r\n$getusernamedata = \"user.username = \'\" . addslashes($vbulletin->userinfo[username]) . \"\' OR \";\r\n// We don\'t want to include not logged in users in this report (because of the unregistered-name).\r\n// So we\'re removing it here instead of looking for unregged usernames in the database.\r\nif ($vbulletin->userinfo[userid] == 0) {$getusernamedata = \"\";}\r\n\r\n$lcountsql = \"SELECT DISTINCT users.userid,users.username,users.userlink,users.r ealip,users.timestamp,users.fo rwarded_for,users.http_via,user.userid\r\nFROM \" . TABLE_PREFIX . \"user_troll AS users\r\nINNER JOIN \" . TABLE_PREFIX . \"user_troll as user\r\nON (users.username = user.username)\r\nOR (users.userlink = user.userid AND users.userlink > 0)\r\nOR (users.realip = user.realip)\r\nOR (users.forwarded_for LIKE \'%$trollremote%\' AND users.forwarded_for != \'\')\r\nOR (users.http_via LIKE \'%$trollremote%\' AND users.http_via != \'\')\r\nWHERE user.userid > 0 AND users.userid > 0\r\nAND (\r\n $getusernamedata user.realip = \'$trollremote\'\r\n )\r\nAND user.deleted = 0\r\nAND users.deleted = 0\r\nAND user.fqdn = 0\r\nAND users.fqdn = 0\r\nGROUP by username\r\nORDER by timestamp DESC\r\n\";\r\n\r\n// Do not include FQDN-names into this listing - FQDN-names are not duplicate usernames, just identifiers\r\n$lcount = $vbulletin->db->query($lcountsql);\r\n\r\n// Collect nicknames to the dupechecker\r\n while ($trollArray = $vbulletin->db->fetch_array($lcount)) {\r\n\r\n // Must not be empty\r\n if ($trollArray[username]) {\r\n $trollnicksUID[$trollArray[userid]] = $trollArray[userid];\r\n $trollnicksNAME[strtolower($trollArray[username])] = strtolower($trollArray[username]);\r\n $trollnicksIP[$trollArray[realip]] = $trollArray[realip];\r\n\r\n if ($trollArray[userid] > 0) {$trolls .= $trollArray[username] . \"\\n\";}\r\n $linked++;\r\n }\r\n }\r\n\r\n\r\n// Fixes ontheirway! (060919)\r\n$trolls = addslashes($trolls);\r\n\r\n// If the own nick is missing, add it.\r\nif (!$trollnicksNAME[strtolower($trollusername)] AND $vbulletin->userinfo[userid] > 0) {$trolls .= $vbulletin->userinfo[username] . \"\\n\";}\r\n\r\n$vbulletin->db->query_write(\"INSERT INTO \" . TABLE_PREFIX . \"user_trollcache (userid, realip, nicks, timestamp) VALUES (\'\" . $vbulletin->userinfo[userid] . \"\', \'$trollremote\', \'$trolls\', \" . TIMENOW . \")\");\r\n\r\n} // End if cachevar\r\n\r\n}\r\n\r\n/**** COUNTING OF USER\'S NICKNAMES FINISH ****/\r\n\r\n\r\n/**** ALERT SECTION BEGIN ****/\r\n if (($trollalertuser OR $trollalertforum) AND $linked >= $trollalertafter AND $trollalertfrom > 0 AND $vbulletin->userinfo[userid] > 0) {\r\n // Used vars: $trollalertuser, $trollalertforum (Update database)\r\n\r\n $trolldupechanges = $vbulletin->db->query_first(\"SELECT * FROM \" . TABLE_PREFIX . \"user_trolldupes WHERE userid = \'\" . $vbulletin->userinfo[userid] . \"\' AND userid > 0\");\r\n\r\n if (!$trolldupechanges[nicklist]) {\r\n // Do not write guests into this list, that will cause trouble on reporting...\r\n if ($vbulletin->userinfo[userid] > 0) {\r\n $vbulletin->db->query_write(\"INSERT INTO \" . TABLE_PREFIX . \"user_trolldupes (userid, nicklist) VALUES (\'\" . $vbulletin->userinfo[userid] . \"\', \'\" . $trolls . \"\')\");\r\n }\r\n }\r\n\r\n // Report on changes...\r\n if ($trolls != $trolldupechanges[nicklist] AND $trolls) {\r\n $doreporttrolls = 1;\r\n\r\n // If there\'s an old nicklist, it\'s time to update here...\r\n if ($trolldupechanges[userid] == $vbulletin->userinfo[userid] AND $vbulletin->userinfo[userid] > 0 AND $trolldupechanges[userid] > 0) {\r\n $vbulletin->db->query_write(\"UPDATE \" . TABLE_PREFIX . \"user_trolldupes SET nicklist = \'$trolls\' WHERE userid = \'\" . $vbulletin->userinfo[userid] . \"\'\");\r\n }\r\n\r\n }\r\n\r\n$blockstatus = \"\";\r\n\r\n// Report normal blockings\r\nif ($linked >= $trollblock AND $trollblock > 0 AND $istrolladmin != 1 AND THIS_SCRIPT != \'iptracker.php\') {$blockstatus = $vbphrase[troll_report_blocked];}\r\n\r\n// Report bans\r\nif ($trollautoblockBans == 1 AND $forcetrollban == 1 AND $istrolladmin != 1 AND THIS_SCRIPT != \'iptracker.php\') {$blockstatus = $vbphrase[troll_report_banned];}\r\n\r\n if ($doreporttrolls == 1 AND $linked >= $trollalertafter) {\r\n $trollqueryuser = fetch_userinfo($trollalertfrom);\r\n\r\n $trollpm =& datamanager_init(\'PM\', $vbulletin, ERRTYPE_SILENT);\r\n // Send PM if options are set for PM\r\n if ($trollalertuser) {\r\n $trollpm->set(\'fromuserid\', $trollqueryuser[userid]);\r\n $trollpm->set(\'fromusername\', $trollqueryuser[username]);\r\n $trollpm->set_info(\'reciept\', false);\r\n $trollpm->set_info(\'savecopy\', false);\r\n $trollpm->set(\'title\', construct_phrase($vbphrase[troll_alertsubject], $vbulletin->userinfo[username]));\r\n $trollpm->set(\'message\', construct_phrase($vbphrase[troll_alertmessage], $vbulletin->userinfo[username], $trolls, $blockstatus));\r\n $trollpm->set_recipients($trollalertuser, $trollqueryuser[permissions]);\r\n $trollpm->set(\'dateline\', TIMENOW);\r\n $trollpm->save();\r\n }\r\n\r\n if ($trollalertforum) {\r\n $t_smilies = 1;\r\n $t_visible = 1;\r\n require_once(DIR . \'/includes/class_dm_threadpost.php\');\r\n $trollreport = new vB_DataManager_Thread_FirstPost($vbulletin, ERRTYPE_STANDARD);\r\n $trollreport->do_set(\'forumid\', $trollalertforum);\r\n $trollreport->do_set(\'userid\', $trollqueryuser[\'userid\']);\r\n $trollreport->do_set(\'username\', $trollqueryuser[\'username\']);\r\n $trollreport->do_set(\'title\', construct_phrase($vbphrase[troll_alertsubject], $vbulletin->userinfo[username]));\r\n $trollreport->do_set(\'pagetext\', construct_phrase($vbphrase[troll_alertmessage], $vbulletin->userinfo[username], $trolls, $blockstatus));\r\n $trollreport->do_set(\'allowsmilie\', $t_smilies);\r\n $trollreport->do_set(\'visible\', $t_visible);\r\n $sendtrollreport = $trollreport->save();\r\n \r\n require_once(DIR . \'/includes/functions_databuild.php\');\r\n build_forum_counters($trollalertforum);\r\n }\r\n }\r\n\r\n // Update database, so we won\'t get repeating in the forum and PM\'s\r\n $vbulletin->db->query_write(\"UPDATE user_troll SET alert = \" . TIMENOW . \" WHERE userid = \'\" . $vbulletin->userinfo[userid] . \"\' AND deleted = 0 ORDER by alert DESC LIMIT 1\");\r\n\r\n }\r\n/**** ALERT SECTION FINISH ****/\r\n\r\n\r\n/**** BLOCK TROLLS ON REQUEST BEGIN ****/\r\n// Check for special blocks start\r\n$trollblocknames = explode(\"\\n\", preg_replace(\"[\\r]\", \"\", strtolower($vbulletin->options[\'trollblockuser\'])));\r\n$trollexcludenames = explode(\"\\n\", preg_replace(\"[\\r]\", \"\", strtolower($vbulletin->options[\'trollexcludeuser\'])));\r\n\r\n foreach ($trollexcludenames as $texclude => $excludenames) {$exclude[strtolower($excludenames)] = strtolower($excludenames);}\r\n\r\n// Want to block banned users from forum? Array it here...\r\nif ($trollautoblockBans == 1) {\r\n $trollbans = $vbulletin->db->query(\"SELECT * from \" . TABLE_PREFIX . \"userban\");\r\n\r\n while ($trollban = $vbulletin->db->fetch_array($trollbans)) {\r\n $realuserBAN = fetch_userinfo($trollban[userid]);\r\n if ($trollautoblockBans == 1) {\r\n // Force ban if any matches, but only if user is not admin...\r\n if (strtolower($trollnicksUID[$trollban[userid]]) == strtolower($trollban[userid]) AND $istrolladmin != 1) {\r\n $trollbanreason = $trollban[\'reason\'];\r\n if ($trollban[\'liftdate\']) {\r\n $trollbandate = vbdate($vbulletin->options[\'dateformat\'] . \', \' . $vbulletin->options[\'timeformat\'], $trollban[\'liftdate\']);\r\n } else {\r\n $trollbandate = $vbphrase[\'never\'];\r\n }\r\n $forcetrollban = 1;\r\n }\r\n if (strtolower($trollnicksNAME[$realuserBAN[username]]) == strtolower($realuserBAN[username]) AND $istrolladmin != 1) {\r\n $trollbanreason = $trollban[\'reason\'];\r\n if ($trollban[\'liftdate\']) {\r\n $trollbandate = vbdate($vbulletin->options[\'dateformat\'] . \', \' . $vbulletin->options[\'timeformat\'], $trollban[\'liftdate\']);\r\n } else {\r\n $trollbandate = $vbphrase[\'never\'];\r\n }\r\n $forcetrollban = 1;\r\n }\r\n }\r\n\r\n }\r\n if (!$trollbanreason) {$vbphrase[\'none\'];}\r\n}\r\n// End banblock array\r\n\r\nforeach ($trollblocknames as $trollers) {\r\n $counttrollblock++;\r\n if ($trollers > 0 && $vbulletin->userinfo[\'userid\'] == $trollers) {$dotrollblock = 1;}\r\n if ($trollers < 1 && strtolower($vbulletin->userinfo[\'username\']) == strtolower($trollers)) {$dotrollblock = 1;}\r\n\r\n // Linkmatching - Block the current logged in user if there\'s a match with the userlist in options.\r\n // This includes IP from v2.0.2 and up\r\n if (strtolower($trollers) == strtolower($trollnicksUID[$trollers])) {$dotrollblock = 1;}\r\n if (strtolower($trollers) == strtolower($trollnicksNAME[$trollers])) {$dotrollblock = 1;}\r\n if (strtolower($trollers) == strtolower($trollnicksIP[$trollers])) {$dotrollblock = 1;}\r\n}\r\n\r\n// If there is a count in the userlist, the blocklist is active. Of there\'s matches on the current\r\n// logged in userid/username, check how many userlinks we find. Then block if everything is ok\r\nif ($counttrollblock > 0 AND $dotrollblock == 1 AND $linked >= $trollblockusertrig) {\r\n $trollblock = $trollblockusertrig;\r\n }\r\n// Check for special blocks end\r\n\r\nif (strtolower($trollusername) == strtolower($exclude[$trollusername]) OR $vbulletin->userinfo[userid] == $exclude[$trolluserid]) {\r\n $forcetrollban = 0;\r\n $linked = 0;\r\n }\r\n\r\n/** BLOCKING AND BANNING BEGIN **/\r\n// Protect admins from being blocked\r\nif ($trollautoblockBans == 1 AND $forcetrollban == 1 AND $istrolladmin != 1 AND THIS_SCRIPT != \'iptracker.php\') {\r\n eval(\'$headinclude = \"\' . fetch_template(\'headinclude\') . \'\";\');\r\n eval(standard_error(fetch_error(\'nopermission_ban ned\', $trollbanreason, $trollbandate)));\r\n }\r\n\r\nif ($linked >= $trollblock AND $trollblock > 0 AND $istrolladmin != 1 AND THIS_SCRIPT != \'iptracker.php\') {\r\n $vbulletin->userinfo[\'badlocation\'] =1;\r\n $errormessage = construct_phrase($vbphrase[\'trollerror_toomanynicks\'], $linked);\r\n eval(\'$headinclude = \"\' . fetch_template(\'headinclude\') . \'\";\');\r\n eval(\'$header = \"\' . fetch_template(\'header\') . \'\";\');\r\n eval(\'$footer = \"\' . fetch_template(\'footer\') . \'\";\');\r\n eval(\'print_output(\"\' . fetch_template(\'STANDARD_ERROR\') . \'\");\');\r\n}\r\n/** BLOCKING AND BANNING FINISH **/\r\n\r\n\r\n/**** BLOCK TROLLS ON REQUEST FINISH ****/\r\n\r\n\r\n\r\n/******** CONTINUE IF THE USER ISN\'T BLOCKED ********/\r\n\r\n\r\n\r\n/**** RBL MONITORING BEGIN ****/\r\n// Is the rbl monitor installed?\r\nif ($rblInstalled) {\r\n // Are we allowed to look for proxies?\r\n if ($trollignoreopm == 1 OR $trollwarnopm == 1) {\r\n // Just return the value returned from the monitor\r\n $trollIsOPM = rbl_livecheck(1, $trollremote);\r\n }\r\n } else {\r\n // If nothing is correct, just say 0\r\n $trollIsOPM = 0;\r\n }\r\n/**** RBL MONITORING FINISH ****/\r\n\r\n\r\n\r\n\r\n\r\n/**** FQDN RESOLVE BEGIN ****/\r\n if ($trollFQDN AND $trolluseFQDN == 1) {\r\n // First, grab the names and split up with userid\r\n $trollFQnames = explode(\"\\n\", preg_replace(\"[\\r]\", \"\", $trollFQDN));\r\n foreach ($trollFQnames as $t_FQ => $trollresolve) {\r\n $trollrescache = $vbulletin->db->query(\"SELECT * from \" . TABLE_PREFIX . \"user_trollresolver WHERE host = \'$trollresolve\'\");\r\n $trollhost = array();\r\n $countcache = -1;\r\n // Can this host be found in the cache?\r\n while ($rescache = $vbulletin->db->fetch_array($trollrescache)) {$trollhost[$countcache++] = $rescache[ip];}\r\n\r\n // If nothing found in cache, start resolve the host\r\n $docache = 0;\r\n if ($countcache < 1) {\r\n $trollhost = gethostbynamel($trollresolve); // Array for full resolving\r\n $docache = 1; // Also remember the host as register-in-cache\r\n }\r\n\r\n // Now start looking up all resolved ips (yes, we support multiple ips under one FQDN)\r\n foreach ($trollhost as $trollip) {\r\n // If we have a match, save it with the userid where it belong\r\n if ($trollremote == $trollip) {$FQDNresolved[$trollresolve] = true;}\r\n // Don\'t forget to cache this host so we don\'t have to resolve it the next time\r\n if ($docache == 1) {\r\n $vbulletin->db->query_write(\"INSERT INTO \" . TABLE_PREFIX . \"user_trollresolver (host, ip, dateline) VALUES (\'$trollresolve\', \'$trollip\', \" . TIMENOW . \")\");\r\n }\r\n }\r\n\r\n }\r\n\r\n // Start fixing with the trolldb...\r\n foreach ($FQDNresolved as $FQDN => $Fvalue) {\r\n // IP ($trollremote), user ($Fvalue), FQDN ($FQDN)\r\n\r\n $realuserFQDN = fetch_userinfo($Fvalue);\r\n $findhost = $vbulletin->db->query_first(\"SELECT * FROM \" . TABLE_PREFIX . \"user_troll WHERE realip = \'$trollremote\' AND username = \'\" . $FQDN . \"\'\");\r\n\r\n // If this host isn\'t registered to the tracker, it\'s time to register (or update) it now, but do not interfere with the regular data (that\'s why we use the fqdn-field here!)\r\n\r\n if (!$findhost[idx]) {\r\n $vbulletin->db->query_write(\"INSERT INTO \" . TABLE_PREFIX . \"user_troll (userid, realip, forwarded_for, username, timestamp, http_via, date, time, opm, fqdn) VALUES (\'$trolluserid\', \'$trollremote\', \'$forwarded\', \'$FQDN\', \'$timestamp\' , \'$via\', \'$trolldate\', \'$trolltime\', \'$trollIsOPM\', \'1\')\");\r\n } else {\r\n $vbulletin->db->query_write(\"UPDATE \" . TABLE_PREFIX . \"user_troll SET timestamp = $timestamp, date = \'$trolldate\', time = \'$trolltime\', opm = \'$trollIsOPM\', imported = 0 WHERE idx = \'\" . $findhost[idx] . \"\' AND deleted = 0 AND fqdn = 1 LIMIT 1\"); }\r\n\r\n }\r\n }\r\n/**** FQDN RESOLVE FINISH ****/\r\n\r\n\r\n\r\n\r\n\r\n/**** STORAGE PREPARE BEGIN ****/\r\n// How to check the database when inserting new entries\r\nif ($followtroll == 1) \r\n {\r\n $trollquery = \"WHERE realip = \'$trollremote\' AND deleted = 0 AND fqdn = 0 ORDER BY timestamp DESC\";\r\n } else {\r\n $trollquery = \"WHERE userid = \'$trolluserid\' AND realip = \'$trollremote\' AND deleted = 0 AND fqdn = 0 ORDER BY timestamp DESC\";\r\n // Switch lookup type, by request\r\n if ($trolluseridlookup == 0) {\r\n $trollquery = \"WHERE username = \'\" . $trollusername . \"\' AND realip = \'$trollremote\' AND deleted = 0 AND fqdn = 0 ORDER BY timestamp DESC\";\r\n }\r\n }\r\n/**** STORAGE PREPARE FINISH ****/\r\n\r\n\r\n\r\n/**** STORAGE DATA COLLECTING BEGIN ****/\r\n$ftroll = $vbulletin->db->query_first(\"SELECT * from \" . TABLE_PREFIX . \"user_troll $trollquery LIMIT 1\");\r\n\r\n$usedtroll = $ftroll[\'realip\'];\r\n$trollid = $ftroll[\'idx\'];\r\n$trolluser = $ftroll[\'userid\'];\r\n\r\n$trollVIA = $ftroll[\'http_via\'];\r\n$trollFOR = $ftroll[\'forwarded_for\'];\r\n\r\nif ($forwarded != $trollFOR OR $via != $trollVIA) {$trollheadermismatch = 1;}\r\n\r\n// If there is any userid found in database, we should check the first nick used by looking up the host and the userlink data\r\nif ($trolluser > 0 AND $trollremote != \'\') {\r\n $firsttroll = $vbulletin->db->query_first(\"SELECT userid,realip,timestamp from \" . TABLE_PREFIX . \"user_troll WHERE userid > 0 AND realip = \'$trollremote\' AND deleted = 0 AND fqdn = 0 ORDER by timestamp DESC, userid ASC LIMIT 1\");\r\n $firsttrollid = $firsttroll[\'userid\'];\r\n\r\n $followlink = $vbulletin->db->query_first(\"SELECT userid,userlink from \" . TABLE_PREFIX . \"user_troll WHERE userid = \'$trolluserid\' AND userlink > 0 AND deleted = 0 AND fqdn = 0 ORDER by userlink ASC LIMIT 1\");\r\n\r\n // Did it? Then replace this id with the first found in db\r\n if ($followlink[\'userlink\'] != $firsttrollid) {$firsttrollid = $followlink[\'userlink\'];}\r\n\r\n // Save data about any user who possibly used this ip first\r\n if ($firsttrollid > 0) {\r\n $vbulletin->db->query_write(\"UPDATE \" . TABLE_PREFIX . \"user_troll SET userlink = \'$firsttrollid\' WHERE idx = \'$trollid\' AND deleted = 0 AND fqdn = 0 LIMIT 1\");\r\n }\r\n}\r\n/**** STORAGE DATA COLLECTING FINISH ****/\r\n\r\n\r\n\r\n/**** SESSION STORAGE BEGIN ****/\r\n// Force updating of the session-table on request (this is stupid!)\r\nif ($trollsession == 1 AND $trollremote != \'\') {\r\n\r\n // Lookup latest used username from specific IP\r\n $lasttroll = $vbulletin->db->query_first(\"SELECT * from \" . TABLE_PREFIX . \"user_troll WHERE userid > 0 AND realip = \'$trollremote\' AND deleted = 0 ORDER BY timestamp DESC LIMIT 1\");\r\n $trolluser = $lasttroll[\'userid\'];\r\n\r\n if ($trolluser) {\r\n $vbulletin->db->query_write(\"UPDATE \" . TABLE_PREFIX . \"session SET userid = \'$trolluser\', lastactivity = $timestamp WHERE host = \'$trollremote\'\");\r\n // If this is true, troller is already found and forced into sessions...\r\n $dosavetroll = 0;\r\n }\r\n\r\n}\r\n/**** SESSION STORAGE FINISH ****/\r\n\r\n\r\n// Do not register not logged in users on request\r\nif ($trollunreg == 0 AND $trolluserid < 1) {$dosavetroll = 0;}\r\n\r\n// Do not save RBL\'s on request\r\nif ($trollignoreopm == 1 AND $trollIsOPM == 1) {$dosavetroll = 0;}\r\n\r\n// Changes in headers?\r\nif ($trollheadermismatch == 1 AND $trolluniqueheaders == 1) {$dosavetroll = 1;}\r\n\r\n\r\n\r\n/**** TROLLDB STORAGE BEGIN ****/\r\nif ($dosavetroll == 1) {\r\n\r\n if (!$usedtroll) {\r\n // If the user wasn\'t found in the database, we will add it...\r\n $vbulletin->db->query_write(\"INSERT INTO \" . TABLE_PREFIX . \"user_troll (userid, realip, forwarded_for, username, timestamp, http_via, date, time, opm) VALUES (\'$trolluserid\', \'$trollremote\', \'$forwarded\', \'\" . $trollusername . \"\', $timestamp, \'$via\', \'$trolldate\', \'$trolltime\', \'$trollIsOPM\')\");\r\n } else {\r\n // Changes will make the database change selected entry to not imported\r\n // If the user was found in the database, we won\'t duplicate it - instead, we\'re updating the latest login\r\n $vbulletin->db->query_write(\"UPDATE \" . TABLE_PREFIX . \"user_troll SET timestamp = $timestamp, date = \'$trolldate\', username = \'\" . $trollusername . \"\', userid = \'$trolluserid\', time = \'$trolltime\', opm = \'$trollIsOPM\', imported = 0 WHERE idx = \'$trollid\' AND deleted = 0 AND fqdn = 0 LIMIT 1\");\r\n }\r\n}\r\n/**** TROLLDB STORAGE FINISH ****/\r\n\r\n\r\n\r\n} // End of enable check... Turns this plugin completely off or on...', 'trolltracker'); MySQL Error : Unknown column 'executionorder' in 'field list' Error Number : 1054 Date : Tuesday, September 19th 2006 @ 05:42:28 PM What now? |
#60
|
||||
|
||||
Sorry. I exported the hack from vB 3.6 so "executionorder" is an unkown database-field for 3.5. I had the same problem when I forgot to remove that field. Fixed now
|
#61
|
||||
|
||||
Many thanks.
Can you please add a small explanation of the functions. I am confused with this: When I enter a username, select resolve IP address, the tracker finds an amount of entries, but does not display them. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|