/upload/includes/report_hack/report_user.php

http://torrentpier2.googlecode.com/ · PHP · 45 lines · 30 code · 6 blank · 9 comment · 1 complexity · cce87f01d52366505297c44f4cec5090 MD5 · raw file

  1. <?php
  2. class report_user extends report_module
  3. {
  4. var $mode = 'reportuser';
  5. var $duplicates = true;
  6. //
  7. // Constructor
  8. //
  9. function report_user($id, $data, $lang)
  10. {
  11. $this->id = $id;
  12. $this->data = $data;
  13. $this->lang = $lang;
  14. }
  15. //
  16. // Returns url to a report subject
  17. //
  18. function subject_url($id, $non_html_amp = false)
  19. {
  20. $sep = ($non_html_amp) ? '&' : '&amp;';
  21. return 'profile.php?mode=viewprofile'. $sep. POST_USERS_URL .'=' . (int) $id;
  22. }
  23. //
  24. // Returns report subject title
  25. //
  26. function subject_obtain($report_subject)
  27. {
  28. $sql = 'SELECT username
  29. FROM ' . BB_USERS . '
  30. WHERE user_id = ' . (int) $report_subject;
  31. if (!$result = DB()->sql_query($sql))
  32. {
  33. message_die(GENERAL_ERROR, 'Could not obtain report subject', '', __LINE__, __FILE__, $sql);
  34. }
  35. $row = DB()->sql_fetchrow($result);
  36. DB()->sql_freeresult($result);
  37. return ($row) ? $row['username'] : false;
  38. }
  39. }