aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2003-05-29 18:28:00 +0000
committerChad Little <clittle@users.sourceforge.net>2003-05-29 18:28:00 +0000
commit74ed9436b9d44a08ec836611dee60353d9020614 (patch)
tree7089d40730971a229ea968e62f8d23c8429577e1
parent572e8a6a1f9dbc8e2a7ac0dc480689487b4217aa (diff)
downloadphpicalendar-74ed9436b9d44a08ec836611dee60353d9020614.tar.gz
phpicalendar-74ed9436b9d44a08ec836611dee60353d9020614.tar.bz2
phpicalendar-74ed9436b9d44a08ec836611dee60353d9020614.zip
More error_reporting cleanup.
-rw-r--r--admin.php7
-rw-r--r--functions/ical_parser.php6
-rw-r--r--functions/init.inc.php14
-rw-r--r--functions/overlapping_events.php28
-rw-r--r--includes/footer.inc.php2
-rw-r--r--print.php4
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 = "<font color=\"red\">$invalid_login_lang</font>";
+ } else {
+ $login_error = '';
+ }
echo <<<EOT
<form action="{$HTTP_SERVER_VARS['PHP_SELF']}" method="post">
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 "<center><font class=\"V9\"><br>$powered_by_lang <a class=\"psf\" href=\"http://phpicalendar.sourceforge.net/nuke/\">PHP iCalendar 0.9.2</a>";
if ($enable_rss == 'yes') {
echo "<br>\n";
- if ($current_view == 'rssindex') {
+ if ((isset($current_view)) && ($current_view == 'rssindex')) {
echo '<a style="color:gray" href="http://feeds.archive.org/validator/check?url='.$footer_check.'"><img src="'.BASE.'images/valid-rss.png" alt="[Valid RSS]" title="Validate my RSS feed" width="88" height="31" border="1" vspace="3" />';
} else {
echo $this_site_is_lang.' <a class="psf" href="'.BASE.'rss/index.php?cal='.$cal.'&amp;getdate='.$getdate.'">RSS-Enabled</a>';
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 = '';
}
?>

© 2014-2024 Faster IT GmbH | imprint | privacy policy