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