session management
Some checks failed
PHPUnit / test (push) Has been cancelled

This commit is contained in:
tom.hempel
2026-06-30 08:35:18 +02:00
parent 7fefc264f4
commit 9db886a1ae
6 changed files with 7026 additions and 5 deletions

View File

@ -185,6 +185,22 @@ case 'POST':
}
break;
}
if (($body['action'] ?? '') === 'deleteAll') {
require_role(['admin'], $tokenRec);
$phrase = trim((string)($body['confirmPhrase'] ?? ''));
if ($phrase !== 'DELETE ALL TRANSLATIONS') {
json_error('CONFIRMATION_REQUIRED', 'Type DELETE ALL TRANSLATIONS to confirm', 400);
}
[$pdo, $tmpDb, $lockFp] = qdb_open_write_or_fail();
try {
$result = qdb_delete_all_translations($pdo, true);
qdb_save($tmpDb, $lockFp);
json_success($result);
} catch (Throwable $e) {
qdb_handler_fail($e, 'Delete all translations', null, $tmpDb, $lockFp);
}
break;
}
json_error('BAD_REQUEST', 'Unknown action', 400);
break;