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