blob: 326dff884315a8e98305b38c060ebaaff708d425 [file] [log] [blame]
<?php
require_once("core.php");
security::checkType(security::ADMIN);
if (!security::checkParams("POST", [
["id", security::PARAM_NEMPTY],
["value", security::PARAM_ISINT]
])) {
security::go("users.php?msg=unexpected");
}
$id = (int)$_POST["id"];
$value = (int)$_POST["value"];
if (schedules::switchActive($id, $value)) {
security::go("schedule.php?id=".(int)$id."&msg=activeswitched".$value);
} else {
security::go("schedule.php?id=".(int)$id."&msg=unexpected");
}