make no_auth reporting work

master
Dirk Heilig 2023-10-11 14:14:41 +02:00
parent 187494cd50
commit bd7e63b617
1 changed files with 11 additions and 6 deletions

View File

@ -90,6 +90,9 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
); );
exit(); exit();
} }
if ($mode === "NO_AUTH") {
$fileName = "backups.json";
} else {
$fileName = $_GET["user"]; $fileName = $_GET["user"];
if (!isset($credentials[$fileName])) { if (!isset($credentials[$fileName])) {
header("HTTP/1.0 404 Not Found"); header("HTTP/1.0 404 Not Found");
@ -97,6 +100,8 @@ if (!isset($credentials[$fileName])) {
exit(); exit();
} }
$fileName .= ".json"; $fileName .= ".json";
}
header("Content-Type: text/plain"); header("Content-Type: text/plain");
$maxAge = isset($_GET["maxage"]) ? intval($_GET["maxage"]) : 28; $maxAge = isset($_GET["maxage"]) ? intval($_GET["maxage"]) : 28;
$maxAge = $maxAge * 60 * 60; $maxAge = $maxAge * 60 * 60;