Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 1 | <?php |
| 2 | require_once("core.php"); |
| 3 | security::checkType(security::HYPERADMIN); |
| 4 | |
| 5 | if (!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 | |
| 16 | if (!intervals::wellFormed([$begins, $ends])) { |
| 17 | security::go("invalidatebulkrecords.php?msg=inverted"); |
| 18 | } |
| 19 | |
| 20 | $flag = true; |
| 21 | |
| 22 | foreach ($_POST["workers"] as $workerid) { |
| 23 | if (!registry::invalidateAll($workerid, $begins, $ends)) $flag = false; |
| 24 | } |
| 25 | |
| 26 | security::go("invalidatebulkrecords.php?msg=".($flag ? "success" : "partialortotalfailure")); |