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 | ["value", security::PARAM_ISINT] |
| 8 | ])) { |
| 9 | security::go("users.php?msg=unexpected"); |
| 10 | } |
| 11 | |
| 12 | $id = (int)$_POST["id"]; |
| 13 | $value = (int)$_POST["value"]; |
| 14 | |
| 15 | if (schedules::switchActive($id, $value)) { |
| 16 | security::go("schedule.php?id=".(int)$id."&msg=activeswitched".$value); |
| 17 | } else { |
| 18 | security::go("schedule.php?id=".(int)$id."&msg=unexpected"); |
| 19 | } |