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_NEMPTY], |
| 7 | ["name", security::PARAM_NEMPTY], |
| 8 | ["emails", security::PARAM_ISSET], |
| 9 | ["parent", security::PARAM_ISSET] |
| 10 | ])) { |
| 11 | security::go("categories.php?msg=empty"); |
| 12 | } |
| 13 | |
| 14 | $id = (int)$_POST["id"]; |
| 15 | $name = $_POST["name"]; |
| 16 | $emails = $_POST["emails"]; |
| 17 | $parent = (int)$_POST["parent"]; |
| 18 | |
| 19 | if (categories::edit($id, $name, $emails, $parent)) { |
| 20 | security::go("categories.php?msg=modified"); |
| 21 | } else { |
| 22 | security::go("categories.php?msg=unexpected"); |
| 23 | } |