isGuest()) { UI::exitError(getMLText("edit_event"),getMLText("access_denied")); } if (!isset($_POST["from"]) && !(isset($_POST["frommonth"]) && isset($_POST["fromday"]) && isset($_POST["fromyear"])) ) { UI::exitError(getMLText("add_event"),getMLText("error_occured")); } if (!isset($_POST["to"]) && !(isset($_POST["tomonth"]) && isset($_POST["today"]) && isset($_POST["toyear"])) ) { UI::exitError(getMLText("add_event"),getMLText("error_occured")); } if (!isset($_POST["name"]) || !isset($_POST["comment"]) ) { UI::exitError(getMLText("add_event"),getMLText("error_occured")); } $name = $_POST["name"]; $comment = $_POST["comment"]; if(isset($_POST["from"])) { $tmp = explode('-', $_POST["from"]); $from = mktime(0,0,0, $tmp[1], $tmp[0], $tmp[2]); } else { $from = mktime(0,0,0, intval($_POST["frommonth"]), intval($_POST["fromday"]), intval($_POST["fromyear"])); } if(isset($_POST["to"])) { $tmp = explode('-', $_POST["to"]); $to = mktime(23,59,59, $tmp[1], $tmp[0], $tmp[2]); } else { $to = mktime(23,59,59, intval($_POST["tomonth"]), intval($_POST["today"]), intval($_POST["toyear"])); } if ($to<=$from){ $to = $from + 86400 -1; } $res = addEvent($from, $to, $name, $comment); if (is_bool($res) && !$res) { UI::exitError(getMLText("add_event"),getMLText("error_occured")); } add_log_line("?name=".$name."&from=".$from."&to=".$to); header("Location:../out/out.Calendar.php?mode=w&day=".date('d', $from)."&year=".date('Y', $from)."&month=".date('m', $from)); ?>