blob: a657efc712e302c020cd8da92c10af5120c4aed6 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once("core.php");
3security::checkType(security::HYPERADMIN);
4
5if (!security::checkParams("POST", [
6 ["begins", security::PARAM_ISDATE],
7 ["ends", security::PARAM_ISDATE],
8 ["workers", security::PARAM_ISARRAY]
9])) {
10 security::go("invalidatebulkrecords.php?msg=empty");
11}
12
13$begins = $_POST["begins"];
14$ends = $_POST["ends"];
15
16if (!intervals::wellFormed([$begins, $ends])) {
17 security::go("invalidatebulkrecords.php?msg=inverted");
18}
19
20$flag = true;
21
22foreach ($_POST["workers"] as $workerid) {
23 if (!registry::invalidateAll($workerid, $begins, $ends)) $flag = false;
24}
25
26security::go("invalidatebulkrecords.php?msg=".($flag ? "success" : "partialortotalfailure"));