api/restore_alert.php
<?php
declare(strict_types=1);
/*
|--------------------------------------------------------------------------
| Dismiss restore alert
|--------------------------------------------------------------------------
|
| Called when the admin acknowledges the "database was auto-restored from
| backup" banner (see brivaciaWriteRestoreAlert()/brivaciaRestoreAlert()
| in includes/backup.php). Just clears the alert file; the actual restore
| already happened automatically before this endpoint is ever hit.
|
*/
require_once __DIR__ . '/../includes/core.php';
require_once __DIR__ . '/../includes/modules/auth.php';
brivaciaRequireApiAuth();
brivaciaSecurityHeaders();
require_once __DIR__ . '/../includes/backup.php';
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
http_response_code(405);
exit;
}
brivaciaRequireCsrf();
brivaciaClearRestoreAlert();
header('Content-Type: application/json; charset=utf-8');
echo json_encode(['ok' => true]);