Project import generated by Copybara.

GitOrigin-RevId: 63746295f1a5ab5a619056791995793d65529e62
diff --git a/src/dobackupdb.php b/src/dobackupdb.php
new file mode 100644
index 0000000..1953cd3
--- /dev/null
+++ b/src/dobackupdb.php
@@ -0,0 +1,15 @@
+<?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"]));
+}