$conv = new phpVnconv(); $ical = new go_ical(); if (isset($_REQUEST['calendar_id']) && ($calendar = $ical->get_calendar($_REQUEST['calendar_id']))) { $event = false; $filename = $conv->VnConv($calendar['name'] . '.ics'); } elseif (isset($_REQUEST['event_id']) && ($event = $ical->get_event($_REQUEST['event_id']))) { $calendar = false; $filename = $conv->VnConv($event['name'] . '.ics'); } if (!isset($filename)) { die($strDataError); } else { $browser = detect_browser(); header('Content-Type: text/calendar'); //header('Content-Length: '.filesize($path)); header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); if ($browser['name'] == 'MSIE') { header('Content-Disposition: attachment; filename="' . $filename . '"'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); } else { header('Pragma: no-cache'); header('Content-Disposition: attachment; filename="' . $filename . '"'); } header('Content-Transfer-Encoding: binary'); if ($calendar) { echo $ical->export_calendar($_REQUEST['calendar_id']); } elseif ($event) { echo $ical->export_event($_REQUEST['event_id']); } }
break; case 'mail': $mail->IsMail(); break; } $mail->Sender = $_SESSION['GO_SESSION']["email"]; $mail->From = $_SESSION['GO_SESSION']["email"]; // $mail->FromName = $name; $mail->FromName = $_SESSION['GO_SESSION']["name"]; $mail->AddReplyTo($_SESSION['GO_SESSION']["email"], $_SESSION['GO_SESSION']["name"]); $mail->WordWrap = 50; $mail->IsHTML(true); $mail->Subject = sprintf($subjectEventInvitation, $name); require_once $GO_MODULES->class_path . 'go_ical.class.inc'; $ical = new go_ical(); $ics_string = $ical->export_event($event_id); if ($ics_string) { $mail->AddStringAttachment($ics_string, $name . '.ics', 'base64', 'text/calendar'); } for ($i = 0; $i < sizeof($participants); $i++) { $id = 0; if ($ab_module) { $user_profile = $ab->get_contact_profile_by_email(smart_addslashes($participants[$i]), $GO_SECURITY->user_id); $id = $user_profile["source_id"]; } else { $user_profile = false; } if (!$user_profile) { $user_profile = $GO_USERS->get_profile_by_email(smart_addslashes($participants[$i])); $id = $user_profile["id"]; }