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.

ajax_claim_report.php 704B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. #declare(strict_types=1);
  3. if (!check_perms('site_moderate_forums') || empty($_POST['id'])) {
  4. print
  5. json_encode(
  6. array(
  7. 'status' => 'failure'
  8. )
  9. );
  10. die();
  11. }
  12. $ID = (int)$_POST['id'];
  13. $DB->query("
  14. SELECT ClaimerID
  15. FROM reports
  16. WHERE ID = '$ID'");
  17. list($ClaimerID) = $DB->next_record();
  18. if ($ClaimerID) {
  19. print
  20. json_encode(
  21. array(
  22. 'status' => 'dupe'
  23. )
  24. );
  25. die();
  26. } else {
  27. $UserID = $LoggedUser['ID'];
  28. $DB->query("
  29. UPDATE reports
  30. SET ClaimerID = '$UserID'
  31. WHERE ID = '$ID'");
  32. print
  33. json_encode(
  34. array(
  35. 'status' => 'success',
  36. 'username' => $LoggedUser['Username']
  37. )
  38. );
  39. die();
  40. }