index.php 672 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. use function Hestiacp\quoteshellarg\quoteshellarg;
  3. ob_start();
  4. include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
  5. // Check token
  6. verify_csrf($_GET);
  7. // Delete as someone else?
  8. if ($_SESSION["userContext"] === "admin" && !empty($_GET["user"])) {
  9. $user = quoteshellarg($user);
  10. }
  11. if (!empty($_GET["domain"])) {
  12. $v_domain = quoteshellarg($_GET["domain"]);
  13. exec(
  14. HESTIA_CMD . "v-delete-web-domain " . $user . " " . $v_domain . " 'yes'",
  15. $output,
  16. $return_var,
  17. );
  18. check_return_code($return_var, $output);
  19. unset($output);
  20. }
  21. $back = $_SESSION["back"];
  22. if (!empty($back)) {
  23. header("Location: " . $back);
  24. exit();
  25. }
  26. header("Location: /list/web/");
  27. exit();