Guest User

Untitled

a guest
Sep 15th, 2014
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.00 KB | None | 0 0
  1. <?php
  2. /**
  3. Created by TheMasterGeneral.
  4. Forum Warning Mod.
  5. Cost: FREE
  6. File: /forumwarn.php
  7. Info: This mod can be used to warn forum posters for doing actions.
  8. The warning will be sent to their events. This mod will not
  9. auto-ban, its just a way to warn users.
  10.  
  11. I expect this to be buggy and lacking security. If bugs arise, please report them
  12. ASAP!!! Thanks!
  13.  
  14. Also, be sure to check out line #
  15. you will need to edit in your game's
  16. intials OR name. (You won't have to
  17. if your game is abbreviated to CID)
  18.  
  19. Extra steps that need to be taken: Make sure to link this somewhere in your
  20. staff panel. The page is set so that anyone with staff powers can use this
  21. page. If you wish to have it set up like how mine is, open your smenu.php
  22. and find:
  23. &gt;  <a href='staff_punit.php?action=unmailform'>Un-Mailban User</a><br />
  24. and under it, paste:
  25. &gt; <a href='forumwarn.php'>Forum Warn</a><br />
  26.  
  27.  */
  28. include"globals.php";
  29. //Test for proper staff levels.
  30. if ($ir['user_level'] <= 1)
  31.     {
  32.         echo 'You do not have permission to be here.';
  33.         $h->endpage();
  34.     }
  35. //Continue
  36. print'<h2>Forum Warning</h2>';
  37.  
  38. //To secure ID input.
  39. //I don't know of any thing in MCC that has userids as something like 233.097
  40. $id= abs(intval($_POST['ID']));
  41. //Print the page.
  42. //Escape the POST. This doesn't get inserted into the db and people are viewing it as well
  43. $_POST['Reason'] = $db->escape(trim($_POST['Reason']));
  44. //Make sure they input a reason greater than maybe 5 chars?
  45. if(!isset($id) && strlen(trim($_POST['Reason'])) >= 5) {
  46. print "Use to warn a user from the CID Forums. This will not auto-ban the user. Please remember that abusing this system will get you removed as staff
  47. and you will be placed in the federal jail.<br><br><br><br>
  48. <br>
  49. <br>
  50. <form action='forumwarn.php' method='post'>
  51. User id: <input type='text' name='ID' />
  52. <br>
  53. <form action='forumwarn.php' method='post'>
  54. Reason: <input type='text' name='Reason' /><br>
  55. <br>
  56. <input type='submit' value='Submit' />
  57. </form>";
  58.  
  59. } else {
  60. $maxMembs = $db->fetch_row($db->query("SELECT COUNT(*) AS `u` FROM `users` WHERE `userid` = {$_POST['ID']}"));
  61. if($_POST['ID'] > $maxMembs['u'])
  62.     {
  63.         echo "Invalid ID specified. Try again.";
  64.                 //kill the script so it doesn't keep running
  65.         exit($h->endpage());
  66.     }
  67. //Add event.
  68. event_add($_POST['ID'],"You have been warned from the CID Forums for the following reason: {$_POST['Reason']} </a> ",$c);
  69. //Add stafflog.
  70. stafflog_add("Forum Warned User ID {$_POST['ID']}
  71. from the forums for {$_POST['Reason']}!");
  72. //Stafflog entry.
  73. echo "User ID #{$_POST['ID']} has been forum warned for the following reason:
  74. <i>{$_POST['Reason']}</i>.
  75. <br><br>Please remember that abusing this system will get you removed as staff
  76. and you will be placed in the federal jail.";
  77.  
  78. /**
  79. Lines 63 and 64 couple lines aren't needed, but serve as
  80. a warning for those who think its okay
  81. to abuse this system. Abusing this system
  82. won't really break the game, but its more
  83. so abuse on the lines of harassment.
  84. */
  85.  
  86.  
  87. }
  88. $h->endpage();
  89. ?>
Advertisement
Add Comment
Please, Sign In to add comment