1. <?php
  2. /*
  3. * @ https://EasyToYou.eu - IonCube v11 Decoder Online
  4. * @ PHP 7.2
  5. * @ Decoder version: 1.0.4
  6. * @ Release: 01/09/2021
  7. */
  8. error_reporting(0);
  9. if (!isset($_POST["main_domain"])) {
  10. header("Location: setup.html");
  11. exit;
  12. }
  13. $domain = parse_url_all($_POST["main_domain"]);
  14. $domain = $domain["host"];
  15. $mainDomain = preg_replace("#^www\\.(.+\\.)#i", "\$1", $domain);
  16. if ($mainDomain == NULL) {
  17. print_r("<b>ERROR:</b> Domain Error. Check domain and try again.");
  18. print_r("<br><br>");
  19. print_r("Following are the correct domain formats:");
  20. print_r("<ul><li>mydomain.com</li><li>myapp.mydomain.com</li></ul>");
  21. exit;
  22. }
  23. print_r("Your main domain is set: <b>" . $mainDomain . "</b>");
  24. $mainDomain = "https://" . $mainDomain;
  25. $toReplace = "http://foodomaamain.com";
  26. $jsFiles = glob("static/js/*");
  27. foreach ($jsFiles as $file) {
  28. if (preg_match("/\\bmain\\b/", $file)) {
  29. $fileContents = file_get_contents($file);
  30. if (strpos($fileContents, $toReplace) !== false) {
  31. $replaced = str_replace("http://foodomaamain.com", $mainDomain, $fileContents);
  32. file_put_contents($file, $replaced);
  33. }
  34. }
  35. }
  36. unlink("setup.html");
  37. unlink("store_config.php");
  38. print_r("<br> <b>Done. </b>");
  39. function parse_url_all($url)
  40. {
  41. $url = substr($url, 0, 4) == "http" ? $url : "http://" . $url;
  42. $d = parse_url($url);
  43. $tmp = explode(".", $d["host"]);
  44. $n = count($tmp);
  45. if (2 <= $n) {
  46. if ($n == 4 || $n == 3 && strlen($tmp[$n - 2]) <= 3) {
  47. $d["domain"] = $tmp[$n - 3] . "." . $tmp[$n - 2] . "." . $tmp[$n - 1];
  48. $d["domainX"] = $tmp[$n - 3];
  49. } else {
  50. $d["domain"] = $tmp[$n - 2] . "." . $tmp[$n - 1];
  51. $d["domainX"] = $tmp[$n - 2];
  52. }
  53. }
  54. return $d;
  55. }
  56. ?>