Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 1 | <?php |
| 2 | require_once("core.php"); |
| 3 | security::checkType(security::ADMIN); |
| 4 | |
| 5 | if (!security::checkParams("POST", [ |
| 6 | ["id", security::PARAM_ISINT] |
| 7 | ])) { |
| 8 | security::go("incidents.php?msg=unexpected"); |
| 9 | } |
| 10 | |
| 11 | $id = (int)$_POST["id"]; |
| 12 | $details = ((isset($_POST["details"]) && is_string($_POST["details"])) ? $_POST["details"] : ""); |
| 13 | |
| 14 | $status = incidents::editDetails($id, $details); |
| 15 | switch ($status) { |
| 16 | case 0: |
| 17 | security::go("incidents.php?msg=modified"); |
| 18 | break; |
| 19 | |
| 20 | case 1: |
| 21 | security::go("incidents.php?msg=cannotmodify"); |
| 22 | break; |
| 23 | |
| 24 | default: |
| 25 | security::go("incidents.php?msg=unexpected"); |
| 26 | } |