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.

ocelot_info.php 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. if (!check_perms('users_mod')) {
  3. error(403);
  4. }
  5. if (isset($_GET['userid']) && is_number($_GET['userid'])) {
  6. $UserHeavyInfo = Users::user_heavy_info($_GET['userid']);
  7. if (isset($UserHeavyInfo['torrent_pass'])) {
  8. $TorrentPass = $UserHeavyInfo['torrent_pass'];
  9. $UserPeerStats = Tracker::user_peer_count($TorrentPass);
  10. $UserInfo = Users::user_info($_GET['userid']);
  11. $UserLevel = $Classes[$UserInfo['PermissionID']]['Level'];
  12. if (!check_paranoia('leeching+', $UserInfo['Paranoia'], $UserLevel, $_GET['userid'])) {
  13. $UserPeerStats[0] = false;
  14. }
  15. if (!check_paranoia('seeding+', $UserInfo['Paranoia'], $UserLevel, $_GET['userid'])) {
  16. $UserPeerStats[1] = false;
  17. }
  18. } else {
  19. $UserPeerStats = false;
  20. }
  21. } else {
  22. $MainStats = Tracker::info();
  23. }
  24. View::show_header('Tracker info');
  25. ?>
  26. <div>
  27. <div class="header">
  28. <h2>Tracker info</h2>
  29. </div>
  30. <div class="linkbox">
  31. <a href="?action=<?=$_REQUEST['action']?>"
  32. class="brackets" />Main stats</a>
  33. </div>
  34. <div class="sidebar">
  35. <div class="box">
  36. <div class="head">
  37. <strong>User stats</strong>
  38. </div>
  39. <div class="pad">
  40. <form method="get" action="">
  41. <input type="hidden" name="action" value="ocelot_info" />
  42. <span class="label">Get stats for user</span><br />
  43. <input type="text" name="userid" placeholder="User ID" value="<?Format::form('userid')?>" />
  44. <input type="submit" value="Go" />
  45. </form>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="main_column">
  50. <div class="box">
  51. <div class="head">
  52. <strong>Numbers and such</strong>
  53. </div>
  54. <div class="pad">
  55. <?php
  56. if (!empty($UserPeerStats)) {
  57. ?>
  58. User ID: <?=$_GET['userid']?><br />
  59. Leeching: <?=$UserPeerStats[0] === false ? "hidden" : number_format($UserPeerStats[0])?><br />
  60. Seeding: <?=$UserPeerStats[1] === false ? "hidden" : number_format($UserPeerStats[1])?><br />
  61. <?php
  62. } elseif (!empty($MainStats)) {
  63. foreach ($MainStats as $Key => $Value) {
  64. if (is_numeric($Value)) {
  65. if (substr($Key, 0, 6) === "bytes ") {
  66. $Value = Format::get_size($Value);
  67. $Key = substr($Key, 6);
  68. } else {
  69. $Value = number_format($Value);
  70. }
  71. } ?>
  72. <?="$Value $Key<br />\n"?>
  73. <?php
  74. }
  75. } elseif (isset($TorrentPass)) {
  76. ?>
  77. Failed to get stats for user <?=$_GET['userid']?>
  78. <?php
  79. } elseif (isset($_GET['userid'])) {
  80. ?>
  81. User <?=display_str($_GET['userid'])?>
  82. doesn't exist
  83. <?php
  84. } else {
  85. ?>
  86. Failed to get tracker info
  87. <?php
  88. }
  89. ?>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. <?php
  95. View::show_footer();