From 74ed9436b9d44a08ec836611dee60353d9020614 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Thu, 29 May 2003 18:28:00 +0000 Subject: More error_reporting cleanup. --- admin.php | 7 +++++-- functions/ical_parser.php | 6 ++++-- functions/init.inc.php | 14 +++++++++----- functions/overlapping_events.php | 28 +++++++++++++++------------- includes/footer.inc.php | 2 +- print.php | 4 ++++ 6 files changed, 38 insertions(+), 23 deletions(-) diff --git a/admin.php b/admin.php index 159e8bf..1c01029 100644 --- a/admin.php +++ b/admin.php @@ -16,7 +16,7 @@ if($HTTP_POST_VARS) {extract($HTTP_POST_VARS, EXTR_PREFIX_SAME, "post_");} if($HTTP_GET_VARS) {extract($HTTP_GET_VARS, EXTR_PREFIX_SAME, "get_");} // Logout by clearing session variables -if ($action == "logout") { +if ((isset($action)) && ($action == "logout")) { $HTTP_SESSION_VARS['phpical_loggedin'] = FALSE; unset($HTTP_SESSION_VARS['phpical_username']); unset($HTTP_SESSION_VARS['phpical_password']); @@ -77,8 +77,11 @@ else { // If User is Not Logged In, Display The Login Page if ($is_loged_in == FALSE) { - if (isset($username)) + if (isset($username)) { $login_error = "$invalid_login_lang"; + } else { + $login_error = ''; + } echo << diff --git a/functions/ical_parser.php b/functions/ical_parser.php index 1ccdde5..05c9909 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -91,7 +91,7 @@ if ($parse_file) { $allday_start, $allday_end, $start, $end, $the_duration, $beginning, $rrule_array, $start_of_vevent, $description, $valarm_description, $start_unixtime, $end_unixtime, - $recurrence_id, $uid, $class, $attendee, $location, $organizer + $recurrence_id, $uid, $class, $location ); $except_dates = array(); @@ -99,6 +99,8 @@ if ($parse_file) { $first_duration = TRUE; $count = 1000000; $valarm_set = FALSE; + $attendee = array(); + $organizer = array(); unset( $until, $bymonth, $byday, $bymonthday, $byweek, $byweekno, @@ -141,7 +143,7 @@ if ($parse_file) { if (!isset($length)) $length = $master_array[$old_start_date][$old_start_time][$uid]['event_length']; if (!isset($description)) $description = $master_array[$old_start_date][$old_start_time][$uid]['description']; removeOverlap($start_date_tmp, $old_start_time, $uid); - unset($master_array[$start_date_tmp][$old_start_time]); + if (isset($master_array[$start_date_tmp][$old_start_time])) unset($master_array[$start_date_tmp][$old_start_time]); $write_processed = false; } else { $write_processed = true; diff --git a/functions/init.inc.php b/functions/init.inc.php index 05326f8..24df31d 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -61,12 +61,16 @@ if (isset($HTTP_GET_VARS['cal']) && $HTTP_GET_VARS['cal'] != '') { $cal_filename = stripslashes($cal_decoded); } } else { - $calcheck = $calendar_path.'/'.$default_cal_check.'.ics'; - $calcheckopen = @fopen($calcheck, "r"); - if ($calcheckopen == FALSE) { - $cal_filename = $default_cal; + if (isset($default_cal_check)) { + $calcheck = $calendar_path.'/'.$default_cal_check.'.ics'; + $calcheckopen = @fopen($calcheck, "r"); + if ($calcheckopen == FALSE) { + $cal_filename = $default_cal; + } else { + $cal_filename = $default_cal_check; + } } else { - $cal_filename = $default_cal_check; + $cal_filename = $default_cal; } } diff --git a/functions/overlapping_events.php b/functions/overlapping_events.php index 362ea96..b90dd04 100644 --- a/functions/overlapping_events.php +++ b/functions/overlapping_events.php @@ -162,20 +162,22 @@ function checkOverlap($ol_start_date, $ol_start_time, $ol_end_time, $ol_uid) { // drei 20021126: function for checking and removing overlapping events function removeOverlap($ol_start_date, $ol_start_time, $ol_key = 0) { global $master_array, $overlap_array; - if (sizeof($overlap_array[$ol_start_date]) > 0) { - $ol_end_time = $master_array[$ol_start_date][$ol_start_time][$ol_key]["event_end"]; - foreach ($overlap_array[$ol_start_date] as $keyBlock => $blockId) { - if (($blockId["blockStart"] <= $ol_start_time) or ($blockId["blockEnd"] >= $ol_start_time)) { - foreach ($blockId["events"] as $keyEvent => $ol_event) { - $master_array[$ol_start_date][$ol_event["time"]][$ol_event["key"]]["event_overlap"] -= 1; - if (($ol_event["time"] == $ol_start_time) and ($ol_event["key"] == $ol_key)) { - unset ($overlap_array[$ol_start_date][$keyBlock]["events"][$keyEvent]); + if (isset($overlap_array[$ol_start_date])) { + if (sizeof($overlap_array[$ol_start_date]) > 0) { + $ol_end_time = $master_array[$ol_start_date][$ol_start_time][$ol_key]["event_end"]; + foreach ($overlap_array[$ol_start_date] as $keyBlock => $blockId) { + if (($blockId["blockStart"] <= $ol_start_time) or ($blockId["blockEnd"] >= $ol_start_time)) { + foreach ($blockId["events"] as $keyEvent => $ol_event) { + $master_array[$ol_start_date][$ol_event["time"]][$ol_event["key"]]["event_overlap"] -= 1; + if (($ol_event["time"] == $ol_start_time) and ($ol_event["key"] == $ol_key)) { + unset ($overlap_array[$ol_start_date][$keyBlock]["events"][$keyEvent]); + } + } + if ($blockId["maxOverlaps"] = 1) { + unset ($overlap_array[$ol_start_date][$keyBlock]); + } else { + $blockId["maxOverlaps"] -= 1; } - } - if ($blockId["maxOverlaps"] = 1) { - unset ($overlap_array[$ol_start_date][$keyBlock]); - } else { - $blockId["maxOverlaps"] -= 1; } } } diff --git a/includes/footer.inc.php b/includes/footer.inc.php index c86f1b9..63f1c5f 100644 --- a/includes/footer.inc.php +++ b/includes/footer.inc.php @@ -3,7 +3,7 @@ echo "

$powered_by_lang PHP iCalendar 0.9.2"; if ($enable_rss == 'yes') { echo "
\n"; - if ($current_view == 'rssindex') { + if ((isset($current_view)) && ($current_view == 'rssindex')) { echo '[Valid RSS]'; } else { echo $this_site_is_lang.' RSS-Enabled'; diff --git a/print.php b/print.php index 4b7b611..4596082 100644 --- a/print.php +++ b/print.php @@ -23,6 +23,8 @@ if ($printview == 'day') { $zero_events = $no_events_day_lang; $print_next_nav = $next_day_lang; $print_prev_nav = $last_day_lang; + $week_start = ''; + $week_end = ''; } elseif ($printview == 'week') { $start_week = localizeDate($dateFormat_week, $start_week_time); $end_week = localizeDate($dateFormat_week, $end_week_time); @@ -41,6 +43,8 @@ if ($printview == 'day') { $zero_events = $no_events_month_lang; $print_next_nav = $next_month_lang; $print_prev_nav = $last_month_lang; + $week_start = ''; + $week_end = ''; } ?> -- cgit v1.2.3