From d71e7bbfad2f07f82df0c515608996d250fd4182 Mon Sep 17 00:00:00 2001 From: Bot Date: Mon, 2 Jan 2017 15:43:36 +0100 Subject: Formatting --- includes/pages/user_ical.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'includes/pages/user_ical.php') diff --git a/includes/pages/user_ical.php b/includes/pages/user_ical.php index 49546e58..05c67d51 100644 --- a/includes/pages/user_ical.php +++ b/includes/pages/user_ical.php @@ -6,30 +6,30 @@ function user_ical() { global $user; - - if (! isset($_REQUEST['key']) || ! preg_match("/^[0-9a-f]{32}$/", $_REQUEST['key'])) { + + if (!isset($_REQUEST['key']) || !preg_match("/^[0-9a-f]{32}$/", $_REQUEST['key'])) { engelsystem_error("Missing key."); } $key = $_REQUEST['key']; - + $user = User_by_api_key($key); if ($user == null) { engelsystem_error("Key invalid."); } - - if (! in_array('ical', privileges_for_user($user['UID']))) { + + if (!in_array('ical', privileges_for_user($user['UID']))) { engelsystem_error("No privilege for ical."); } - + $ical_shifts = load_ical_shifts(); - + send_ical_from_shifts($ical_shifts); } /** * Renders an ical calender from given shifts array. * - * @param array $shifts + * @param array $shifts */ function send_ical_from_shifts($shifts) { @@ -53,7 +53,8 @@ function make_ical_entry_from_shift($shift) { $output = "BEGIN:VEVENT\r\n"; $output .= "UID:" . md5($shift['start'] . $shift['end'] . $shift['name']) . "\r\n"; - $output .= "SUMMARY:" . str_replace("\n", "\\n", $shift['name']) . " (" . str_replace("\n", "\\n", $shift['title']) . ")\r\n"; + $output .= "SUMMARY:" . str_replace("\n", "\\n", $shift['name']) + . " (" . str_replace("\n", "\\n", $shift['title']) . ")\r\n"; if (isset($shift['Comment'])) { $output .= "DESCRIPTION:" . str_replace("\n", "\\n", $shift['Comment']) . "\r\n"; } -- cgit v1.2.3-54-g00ecf