Initial
This commit is contained in:
18
web/download/database/index.php
Normal file
18
web/download/database/index.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
use function Hestiacp\quoteshellarg\quoteshellarg;
|
||||
|
||||
ob_start();
|
||||
include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
|
||||
|
||||
// Check token
|
||||
verify_csrf($_GET);
|
||||
|
||||
$database = quoteshellarg($_GET["database"]);
|
||||
|
||||
exec(HESTIA_CMD . "v-dump-database " . $user . " " . $database . " file", $output, $return_var);
|
||||
|
||||
if ($return_var == 0) {
|
||||
header("Content-type: application/sql");
|
||||
header("Content-Disposition: attachment; filename=" . $output[0]);
|
||||
header("X-Accel-Redirect: " . $output[1]);
|
||||
}
|
||||
Reference in New Issue
Block a user