Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 1 | <?php |
| 2 | require_once("core.php"); |
| 3 | security::checkType(security::WORKER, security::METHOD_NOTFOUND); |
| 4 | security::checkWorkerUIEnabled(); |
| 5 | |
| 6 | if (!isset($_POST["id"])) { |
| 7 | security::notFound(); |
| 8 | } |
| 9 | |
| 10 | $id = (int)$_POST["id"]; |
| 11 | |
| 12 | $record = registry::get($id); |
| 13 | if ($record === false || $record["invalidated"] != 0) security::notFound(); |
| 14 | |
| 15 | $isAdmin = security::isAllowed(security::ADMIN); |
| 16 | if (!$isAdmin) registry::checkRecordIsFromPerson($record["id"]); |
| 17 | |
| 18 | security::go((security::isAdminView() ? "registry.php?msg=" : "userregistry.php?id=".$_SESSION["id"]).(registry::invalidate($id) ? "invalidated" : "unexpected")); |