Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 1 | <?php |
| 2 | require_once("core.php"); |
| 3 | security::checkType(security::HYPERADMIN); |
| 4 | |
| 5 | if (!security::checkParams("POST", [ |
| 6 | ["format", security::PARAM_ISINT] |
| 7 | ])) security::notFound(); |
| 8 | |
| 9 | switch ($_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 | } |