Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame^] | 1 | <?php |
| 2 | require_once(__DIR__."/../core.php"); |
| 3 | security::checkType(security::WORKER, security::METHOD_NOTFOUND); |
| 4 | security::checkWorkerUIEnabled(); |
| 5 | |
| 6 | if (!isset($_GET["id"])) { |
| 7 | security::notFound(); |
| 8 | } |
| 9 | |
| 10 | $id = (int)$_GET["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 | |
| 19 | <form action="doinvalidaterecord.php" method="POST" autocomplete="off"> |
| 20 | <input type="hidden" name="id" value="<?=(int)$id?>"> |
| 21 | <h4 class="mdl-dialog__title">Invalidar elemento del registro</h4> |
| 22 | <div class="mdl-dialog__content"> |
| 23 | <p>¿Estás seguro que quieres eliminar este elemento del registro? <span style="color:#EF5350;font-weight:bold;">Esta acción es irreversible</span></p> |
| 24 | </div> |
| 25 | <div class="mdl-dialog__actions"> |
| 26 | <button type="submit" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--accent">Invalidar</button> |
| 27 | <button data-dyndialog-close class="mdl-button mdl-js-button mdl-js-ripple-effect cancel">Cancelar</button> |
| 28 | </div> |
| 29 | </form> |