blob: f8104e70fc6a651f141999b5b232cca522df935f [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])) {
8 security::go("scheduletemplates.php?msg=unexpected");
9}
10
11$id = (int)$_POST["id"];
12
13if (!schedules::templateExists($id)) {
14 security::go("scheduletemplates.php?msg=unexpected");
15}
16
17if (schedules::removeTemplate($id)) {
18 security::go("scheduletemplates.php?msg=deleted");
19} else {
20 security::go("scheduletemplates.php?msg=unexpected");
21}