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