blob: 326dff884315a8e98305b38c060ebaaff708d425 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once("core.php");
3security::checkType(security::ADMIN);
4
5if (!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
15if (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}