isGuest()) { UI::exitError(getMLText("edit_event"),getMLText("access_denied")); } if (!isset($_POST["frommonth"]) || !isset($_POST["fromday"]) || !isset($_POST["fromyear"]) ) { UI::exitError(getMLText("add_event"),getMLText("error_occured")); } if (!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 = sanitizeString($_POST["name"]); $comment = sanitizeString($_POST["comment"]); $from = mktime(0,0,0, sanitizeString($_POST["frommonth"]), sanitizeString($_POST["fromday"]), sanitizeString($_POST["fromyear"])); $to = mktime(23,59,59, sanitizeString($_POST["tomonth"]), sanitizeString($_POST["today"]), sanitizeString($_POST["toyear"])); if ($to<$from){ $to= mktime(23,59,59, sanitizeString($_POST["frommonth"]), sanitizeString($_POST["fromday"]), sanitizeString($_POST["fromyear"])); } $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=".$_POST["fromday"]."&year=".$_POST["fromyear"]."&month=".$_POST["frommonth"]); ?>