Project import generated by Copybara.
GitOrigin-RevId: 63746295f1a5ab5a619056791995793d65529e62
diff --git a/src/doinvalidatebulkrecords.php b/src/doinvalidatebulkrecords.php
new file mode 100644
index 0000000..a657efc
--- /dev/null
+++ b/src/doinvalidatebulkrecords.php
@@ -0,0 +1,26 @@
+<?php
+require_once("core.php");
+security::checkType(security::HYPERADMIN);
+
+if (!security::checkParams("POST", [
+ ["begins", security::PARAM_ISDATE],
+ ["ends", security::PARAM_ISDATE],
+ ["workers", security::PARAM_ISARRAY]
+])) {
+ security::go("invalidatebulkrecords.php?msg=empty");
+}
+
+$begins = $_POST["begins"];
+$ends = $_POST["ends"];
+
+if (!intervals::wellFormed([$begins, $ends])) {
+ security::go("invalidatebulkrecords.php?msg=inverted");
+}
+
+$flag = true;
+
+foreach ($_POST["workers"] as $workerid) {
+ if (!registry::invalidateAll($workerid, $begins, $ends)) $flag = false;
+}
+
+security::go("invalidatebulkrecords.php?msg=".($flag ? "success" : "partialortotalfailure"));