index.php 496 B

12345678910111213141516171819202122
  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. $database = quoteshellarg($_GET["database"]);
  8. exec(
  9. HESTIA_CMD . "v-dump-database " . $user . " " . $database . " file gzip",
  10. $output,
  11. $return_var,
  12. );
  13. if ($return_var == 0) {
  14. header("Content-type: application/sql");
  15. header("Content-Disposition: attachment; filename=" . $output[0]);
  16. header("X-Accel-Redirect: " . $output[1]);
  17. }