Untitled


SUBMITTED BY: Guest

DATE: Aug. 16, 2018, 1:32 p.m.

FORMAT: PHP

SIZE: 2.3 kB

HITS: 197

  1. // If Receive Post Request
  2. if ($_POST) {
  3. // Get User IP
  4. $request_ip = $_SERVER['REMOTE_ADDR'];
  5. // Define Whitelisted IPs
  6. $ip_whitelist = array("108.170.27.234", "108.170.27.238", "198.15.95.74", "198.15.113.58");
  7. // Process Incoming Variables and Sanitize
  8. $notify_id = intval($_POST["notify_id"]);
  9. $app_id = intval($_POST["app_id"]);
  10. $user_id = preg_replace("/[^a-zA-Z0-9]/", "", $_POST["user_id"]);
  11. $create_time = intval($_POST["create_time"]);
  12. $real_amount = floatval($_POST["real_amount"]);
  13. $credit_amount = floatval($_POST["credit_amount"]);
  14. $retry = intval($_POST["retry"]);
  15. $verify_code = preg_replace("/[^a-zA-Z0-9]/", "", $_POST["verify_code"]);
  16. $more_info = preg_replace("/[^a-zA-Z0-9]/", "", $_POST["more_info"]);
  17. // Check to see if postback post is coming from MinuteStaff Servers
  18. if (in_array($request_ip, $ip_whitelist)) {
  19. // Define Notify Code - Grab from Panel
  20. $notify_code = "";
  21. // Generate the Verification Code by MD5 Hash
  22. $generated_verify_code = md5($notify_code . $app_id . $user_id . $notify_id);
  23. // Insert Entry into Data (for Logging, Duplicate Checking)
  24. // Verify Notification Postback (Optional)
  25. if ($verify_code == $generated_verify_code) {
  26. // Check Database for Duplicate based on notify_id - Make Sure to Use a Variable Fetch Prior to Insert Entry
  27. // Credit User Based on credit_amount
  28. if (($credit_amount > 0) && ($real_amount > 0)) {
  29. // Credit User's Referral (Upline)
  30. // Deduct Earning From User
  31. } else if (($credit_amount < 0) && ($real_amount < 0)) {
  32. // Issue Warning to User, Can Use "extra_detail" to Provide Additional Info to User.
  33. // System Notification (Warning), Send User a Message with "extra_detail"
  34. } else if (($credit_amount == 0.00000) && ($real_amount == 0.00000)) {
  35. }
  36. // Error Out, Bad Verification Code
  37. } else {
  38. // Notify Admin Here of Possible Hijack - Bad Verification Code
  39. }
  40. // Error Out, Bad User IP Address
  41. } else {
  42. // Notify Admin Here of Possible Hijack (Non-Whitelisted IP)
  43. }
  44. }

comments powered by Disqus