BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ip_tracker_history.php 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. #declare(strict_types=1);
  3. /************************************************************************
  4. ||------------|| User IP history page ||---------------------------||
  5. This page lists previous IPs a user has connected to the site with. It
  6. gets called if $_GET['action'] == 'ips'.
  7. It also requires $_GET['userid'] in order to get the data for the correct
  8. user.
  9. ************************************************************************/
  10. define('IPS_PER_PAGE', 25);
  11. if (!check_perms('users_mod')) {
  12. error(403);
  13. }
  14. $UserID = $_GET['userid'];
  15. if (!is_number($UserID)) {
  16. error(404);
  17. }
  18. $DB->query("
  19. SELECT um.Username,
  20. p.Level AS Class
  21. FROM users_main AS um
  22. LEFT JOIN permissions AS p ON p.ID = um.PermissionID
  23. WHERE um.ID = $UserID");
  24. list($Username, $Class) = $DB->next_record();
  25. if (!check_perms('users_view_ips', $Class)) {
  26. error(403);
  27. }
  28. $UsersOnly = $_GET['usersonly'];
  29. View::show_header("Tracker IP address history for $Username");
  30. ?>
  31. <script type="text/javascript">
  32. function ShowIPs(rowname) {
  33. $('tr[name="' + rowname + '"]').gtoggle();
  34. }
  35. </script>
  36. <?php
  37. list($Page, $Limit) = Format::page_limit(IPS_PER_PAGE);
  38. $Perms = get_permissions_for_user($UserID);
  39. if ($Perms['site_disable_ip_history']) {
  40. $Limit = 0;
  41. }
  42. $TrackerIps = $DB->query("
  43. SELECT IP, fid, tstamp
  44. FROM xbt_snatched
  45. WHERE uid = $UserID
  46. AND IP != ''
  47. ORDER BY tstamp DESC
  48. LIMIT $Limit");
  49. $DB->query('SELECT FOUND_ROWS()');
  50. list($NumResults) = $DB->next_record();
  51. $DB->set_query_id($TrackerIps);
  52. $Pages = Format::get_pages($Page, $NumResults, IPS_PER_PAGE, 9);
  53. ?>
  54. <div>
  55. <div class="header">
  56. <h2>Tracker IP address history for <a
  57. href="user.php?id=<?=$UserID?>"><?=$Username?></a></h2>
  58. </div>
  59. <div class="linkbox"><?=$Pages?>
  60. </div>
  61. <table>
  62. <tr class="colhead">
  63. <td>IP address</td>
  64. <td>Torrent</td>
  65. <td>Time</td>
  66. </tr>
  67. <?php
  68. $Results = $DB->to_array();
  69. foreach ($Results as $Index => $Result) {
  70. list($IP, $TorrentID, $Time) = $Result; ?>
  71. <tr class="row">
  72. <td>
  73. <?=$IP?><br /><?=Tools::get_host_by_ajax($IP)?>
  74. <a href="http://whatismyipaddress.com/ip/<?=display_str($IP)?>"
  75. class="brackets tooltip" title="Search WIMIA.com">WI</a>
  76. </td>
  77. <td><a href="torrents.php?torrentid=<?=$TorrentID?>"><?=$TorrentID?></a></td>
  78. <td><?=date('Y-m-d g:i:s', $Time)?>
  79. </td>
  80. </tr>
  81. <?php
  82. }
  83. ?>
  84. </table>
  85. <div class="linkbox">
  86. <?=$Pages?>
  87. </div>
  88. </div>
  89. <?php View::show_footer();