blob: 1953cd3d772338ab24ca4170b1a78d2079d7109c [file] [log] [blame]
<?php
require_once("core.php");
security::checkType(security::HYPERADMIN);
if (!security::checkParams("POST", [
["format", security::PARAM_ISINT]
])) security::notFound();
switch ($_POST["format"]) {
default:
header("Content-Type: application/sql");
header("Content-Disposition: filename=\"registrohorario_backup_".(int)date("Ymd").".sql\"");
header("Cache-control: private");
passthru("mysqldump ".escapeshellarg($conf["db"]["database"])." --host=".escapeshellarg($conf["db"]["host"])." --user=".escapeshellarg($conf["db"]["user"])." --password=".escapeshellarg($conf["db"]["password"]));
}