index.php 635 B

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