blob: 1953cd3d772338ab24ca4170b1a78d2079d7109c [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once("core.php");
3security::checkType(security::HYPERADMIN);
4
5if (!security::checkParams("POST", [
6 ["format", security::PARAM_ISINT]
7])) security::notFound();
8
9switch ($_POST["format"]) {
10 default:
11 header("Content-Type: application/sql");
12 header("Content-Disposition: filename=\"registrohorario_backup_".(int)date("Ymd").".sql\"");
13 header("Cache-control: private");
14 passthru("mysqldump ".escapeshellarg($conf["db"]["database"])." --host=".escapeshellarg($conf["db"]["host"])." --user=".escapeshellarg($conf["db"]["user"])." --password=".escapeshellarg($conf["db"]["password"]));
15}