Advertisement
Guest User

Untitled

a guest
Feb 10th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.65 KB | None | 0 0
  1. <?php
  2. if(!defined('TOP_STARTED')) exit('Site security activated !');
  3. function validate($validate)
  4. {
  5. global $error_message, $error;
  6. if ($validate == 'admin' && logged())
  7. {
  8. if (isset($_POST['submitDelete']) && requestMethod('POST'))
  9. {
  10. $id = safeInput($_POST['id']);
  11. query('DELETE FROM scams WHERE id = ?', array($id));
  12. advancedEmailer($email, SITE_NAME.' - Report Status', 'Your report was rejected by our administration. Think this is a mistake? Contact us.');
  13. writeSession('report_success', '<div class="alert alert-success" role="alert" style="margin: 0 0 15px 0"><span class="sr-only">Success:</span>Report successfully removed from database. Email for author sent.</div>');
  14. redirect(SITE_LINK);
  15. }
  16. if (isset($_POST['submitVerify']) && requestMethod('POST'))
  17. {
  18. $id = safeInput($_POST['id']);
  19. $email = safeInput($_POST['email']);
  20. query('UPDATE scams SET status = 1 WHERE id = ?', array($id));
  21.  
  22. advancedEmailer($email, SITE_NAME.' - Report Status', 'Your report was approved by our administration. Thank you.');
  23. writeSession('report_success', '<div class="alert alert-success" role="alert" style="margin: 0 0 15px 0"><span class="sr-only">Success:</span>Report verified. Email for author sent.</div>');
  24. redirect(safeInput($_SERVER['HTTP_REFERER']));
  25.  
  26. }
  27. }
  28. if ($validate == 'login')
  29. {
  30. if (isset($_POST['submit']) && requestMethod('POST'))
  31. {
  32. $username = safeInput($_POST['username']);
  33. $password = safeInput($_POST['password']);
  34.  
  35. if (IoE($username, $password))
  36. {
  37. $check = numRows("SELECT COUNT(*) FROM users WHERE name = :name AND password = :pass", array(':name' => $username, ':pass' => passEncode($password)));
  38. if ($check == 1)
  39. {
  40. # ok
  41. }
  42. else
  43. {
  44. set_error('Incorrect username or password', true);
  45. }
  46. }
  47. else
  48. {
  49. set_error('Don\'t leave empty fields', true);
  50. }
  51.  
  52. if (!$error)
  53. {
  54. $user_id = fetchArray("SELECT id FROM users WHERE name = :name AND password = :pass LIMIT 1", array(':name' => $username, ':pass' => passEncode($password)));
  55. writeSession('logged', 1);
  56. writeSession('user_id', safeInput($user_id['id']));
  57. redirect(SITE_LINK);
  58. }
  59. else
  60. {
  61. process_error('login_error', safeInput($_SERVER['HTTP_REFERER']));
  62. }
  63. }
  64. }
  65. elseif ($validate == 'report-scammer')
  66. {
  67. if (isset($_POST['submit']) && requestMethod('POST'))
  68. {
  69. $title = safeInput($_POST['title']);
  70. $seo_title = SEO_link($title);
  71. $version = safeInput($_POST['version']);
  72. $type = safeInput($_POST['type']);
  73. $discordId = safeInput($_POST['discordId']);
  74. $uniqueId = safeInput($_POST['uniqueId']);
  75. $skype = safeInput($_POST['skype']);
  76. $username = safeInput($_POST['username']);
  77. $bought = safeInput($_POST['bought']);
  78. $outsidelink = safeInput($_POST['outsidelink']);
  79. $description = HTMLPurified($_POST['description']);
  80. $by = safeInput($_POST['by']);
  81. $youremail = safeInput($_POST['youremail']);
  82. $paymentMethod = safeInput($_POST['paymentMethod']);
  83. $scamtype = safeInput($_POST['scamtype']);
  84. $paymentInfo = safeInput($_POST['paymentInfo']);
  85. $scamExtra = safeInput($_POST['scamExtra']);
  86.  
  87. if ($skype || $discordId || $username)
  88. {
  89. # ok
  90. } else {
  91. set_error('Plase add one of the following - scammer Skype or Email or Discord ID details', true);
  92. }
  93.  
  94. if (IoE($title, $seo_title, $description, $youremail))
  95. {
  96. # ok
  97. }
  98. else
  99. {
  100. set_error('Don\'t leave empty fields', true);
  101. }
  102.  
  103. if (!$error)
  104. {
  105. query("
  106. INSERT INTO
  107. scams (title, seo_title, version, type, paymentMethod, paymentInfo, scamtype, scamExtra, discordId, uniqueId, skype, username, bought, outsidelink, description, author, authoremail, date)
  108. VALUES (
  109. :title,
  110. :seo_title,
  111. :version,
  112. :type,
  113. :paymentMethod,
  114. :paymentInfo,
  115. :scamtype,
  116. :scamExtra,
  117. :discordId,
  118. :uniqueId,
  119. :skype,
  120. :username,
  121. :bought,
  122. :outsidelink,
  123. :description,
  124. :by,
  125. :youremail,
  126. :datea)",
  127. array(
  128. ':title' => $title,
  129. ':seo_title' => $seo_title,
  130. ':version' => $version,
  131. ':type' => $type,
  132. ':paymentMethod' => $paymentMethod,
  133. ':paymentInfo' => $paymentInfo,
  134. ':scamtype' => $scamtype,
  135. ':scamExtra' => $scamExtra,
  136. ':discordId' => $discordId,
  137. ':uniqueId' => $uniqueId,
  138. ':skype' => $skype,
  139. ':username' => $username,
  140. ':bought' => $bought,
  141. ':outsidelink' => $outsidelink,
  142. ':description' => $description,
  143. ':by' => $by,
  144. ':youremail' => $youremail,
  145. ':datea' => date('Y-m-d H:i')));
  146. advancedEmailer('rscammers@gmail.com', SITE_NAME.' - New Report Submitted', 'Boss, new report has been submitted. Go and verify/delete it. Have a nice day.');
  147. writeSession('report_success', '<div class="alert alert-success" role="alert" style="margin: 0 0 15px 0"><span class="sr-only">Success:</span>Report Created. Our administration will review it and will send you an email with confirmation status</div>');
  148. redirect(safeInput($_SERVER['HTTP_REFERER']));
  149. }
  150. else
  151. {
  152. process_error('report_error', safeInput($_SERVER['HTTP_REFERER']));
  153. }
  154. }
  155. }
  156. elseif ($validate == 'report-scammer-update')
  157. {
  158. if (isset($_POST['submit']) && requestMethod('POST'))
  159. {
  160. $id = safeInput($_POST['id']);
  161. $title = safeInput($_POST['title']);
  162. $seo_title = SEO_link($title);
  163. $version = safeInput($_POST['version']);
  164. $type = safeInput($_POST['type']);
  165. $discordId = safeInput($_POST['discordId']);
  166. $uniqueId = safeInput($_POST['uniqueId']);
  167. $skype = safeInput($_POST['skype']);
  168. $username = safeInput($_POST['username']);
  169. $bought = safeInput($_POST['bought']);
  170. $outsidelink = safeInput($_POST['outsidelink']);
  171. $description = HTMLPurified($_POST['description']);
  172. $by = safeInput($_POST['by']);
  173. $youremail = safeInput($_POST['youremail']);
  174. $paymentMethod = safeInput($_POST['paymentMethod']);
  175. $scamtype = safeInput($_POST['scamtype']);
  176. $paymentInfo = safeInput($_POST['paymentInfo']);
  177. $scamExtra = safeInput($_POST['scamExtra']);
  178.  
  179. if ($skype || $discordId || $username)
  180. {
  181. # ok
  182. } else {
  183. set_error('Plase add one of the following - scammer Skype or Email or Discord ID details', true);
  184. }
  185.  
  186. if (IoE($title, $seo_title, $description, $youremail))
  187. {
  188. # ok
  189. }
  190. else
  191. {
  192. set_error('Don\'t leave empty fields', true);
  193. }
  194.  
  195. if (!$error)
  196. {
  197. query("
  198. UPDATE
  199. scams
  200. SET
  201. title = :title,
  202. seo_title = :seo_title,
  203. version = :version,
  204. type = :type,
  205. paymentMethod = :paymentMethod,
  206. paymentInfo = :paymentInfo,
  207. scamtype = :scamtype,
  208. scamExtra = :scamExtra,
  209. discordId = :discordId,
  210. uniqueId = :uniqueId,
  211. skype = :skype,
  212. username = :username,
  213. bought = :bought,
  214. outsidelink = :outsidelink,
  215. description = :description,
  216. author = :by,
  217. authoremail = :youremail
  218. WHERE
  219. id = :id",
  220. array(
  221. ':title' => $title,
  222. ':seo_title' => $seo_title,
  223. ':version' => $version,
  224. ':type' => $type,
  225. ':paymentMethod' => $paymentMethod,
  226. ':paymentInfo' => $paymentInfo,
  227. ':scamtype' => $scamtype,
  228. ':scamExtra' => $scamExtra,
  229. ':discordId' => $discordId,
  230. ':uniqueId' => $uniqueId,
  231. ':skype' => $skype,
  232. ':username' => $username,
  233. ':bought' => $bought,
  234. ':outsidelink' => $outsidelink,
  235. ':description' => $description,
  236. ':by' => $by,
  237. ':youremail' => $youremail,
  238. ':id' => $id));
  239. writeSession('report_success', '<div class="alert alert-success" role="alert" style="margin: 0 0 15px 0"><span class="sr-only">Success:</span>Report updated.</div>');
  240. redirect(safeInput($_SERVER['HTTP_REFERER']));
  241. }
  242. else
  243. {
  244. process_error('report_error', safeInput($_SERVER['HTTP_REFERER']));
  245. }
  246. }
  247. }
  248. elseif ($validate == 'search')
  249. {
  250. if (isset($_POST['submit_me']) && requestMethod('POST'))
  251. {
  252. $keyword = safeInput($_POST['keyword']);
  253.  
  254. if (IoE($keyword))
  255. {
  256. # ok
  257. }
  258. else
  259. {
  260. set_error('Error', true);
  261. }
  262.  
  263. if (!$error)
  264. {
  265. redirect(SITE_LINK.'/search='.$keyword);
  266. }
  267. else
  268. {
  269. process_error('search_error', safeInput($_SERVER['HTTP_REFERER']));
  270. }
  271. }
  272. }
  273. elseif ($validate == 'appealReport')
  274. {
  275. if (isset($_POST['submit']) && requestMethod('POST'))
  276. {
  277. $email = safeInput($_POST['email']);
  278. $message = safeInput($_POST['message']);
  279.  
  280. if (IoE($email, $message))
  281. {
  282. # ok
  283. }
  284. else
  285. {
  286. set_error('Don\'t leave empty fields', true);
  287. }
  288.  
  289. if (!$error)
  290. {
  291. writeSession('contact_success', '<div class="alert alert-success" role="alert" style="margin: 0 0 15px 0"><span class="sr-only">Success:</span>Your message was successfully sent! You should receive confirmation email shortly</div>');
  292. advancedEmailer('rscammers@gmail.com', SITE_NAME.' Report<strong>From:</strong> '.$email.'<br><strong>Link:</strong>'.safeInput($_SERVER['HTTP_REFERER']).'<br><strong>Message:</strong><br>'.$message);
  293. redirect(safeInput($_SERVER['HTTP_REFERER']));
  294. }
  295. else
  296. {
  297. process_error('contact_error', safeInput($_SERVER['HTTP_REFERER']));
  298. }
  299. }
  300. }
  301. elseif ($validate == 'contact')
  302. {
  303. if (isset($_POST['submit']) && requestMethod('POST'))
  304. {
  305. $name = safeInput($_POST['name']);
  306. $topic = safeInput($_POST['topic']);
  307. $email = safeInput($_POST['email']);
  308. $message = safeInput($_POST['message']);
  309.  
  310. $confirmation = 'Hey, '.$name.'!<br>Your message was successfully received. We will get back to you shortly!<br><strong>Topic:</strong> '.$topic.'<br><strong>Message:</strong><br>'.$message;
  311.  
  312. if (IoE($name, $topic, $email, $message))
  313. {
  314. # ok
  315. }
  316. else
  317. {
  318. set_error('Don\'t leave empty fields', true);
  319. }
  320.  
  321. if (!$error)
  322. {
  323. writeSession('contact_success', '<div class="alert alert-success" role="alert" style="margin: 15px 0 0 0"><span class="sr-only">Success:</span>Your message was successfully sent! You should receive confirmation email shortly</div>');
  324. advancedEmailer('rscammers@gmail.com', SITE_NAME.' New Message - '.$topic, '<strong>From:</strong> '.$email.' ('.$name.')<br><strong>Message:</strong><br>'.$message);
  325. advancedEmailer($email, SITE_NAME.' - Message confirmation', $confirmation);
  326. redirect(safeInput($_SERVER['HTTP_REFERER']));
  327. }
  328. else
  329. {
  330. process_error('contact_error', safeInput($_SERVER['HTTP_REFERER']));
  331. }
  332. }
  333. }
  334. }
  335. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement