Project import generated by Copybara.
GitOrigin-RevId: 63746295f1a5ab5a619056791995793d65529e62
diff --git a/src/doinvalidaterecord.php b/src/doinvalidaterecord.php
new file mode 100644
index 0000000..2799922
--- /dev/null
+++ b/src/doinvalidaterecord.php
@@ -0,0 +1,18 @@
+<?php
+require_once("core.php");
+security::checkType(security::WORKER, security::METHOD_NOTFOUND);
+security::checkWorkerUIEnabled();
+
+if (!isset($_POST["id"])) {
+ security::notFound();
+}
+
+$id = (int)$_POST["id"];
+
+$record = registry::get($id);
+if ($record === false || $record["invalidated"] != 0) security::notFound();
+
+$isAdmin = security::isAllowed(security::ADMIN);
+if (!$isAdmin) registry::checkRecordIsFromPerson($record["id"]);
+
+security::go((security::isAdminView() ? "registry.php?msg=" : "userregistry.php?id=".$_SESSION["id"]).(registry::invalidate($id) ? "invalidated" : "unexpected"));