Exemplo n.º 1
0
    die("incorrect date format");
}
if (!preg_match("/^[0-9]*\$/i", $cutoffDateFuture)) {
    die("incorrect date format");
}
if (empty($cutoffDatePast)) {
    $cutoffDatePast = time() - 14 * 24 * 3600;
}
if (empty($cutoffDateFuture)) {
    $cutoffDateFuture = time() + 84 * 24 * 3600;
}
if (isset($_GET["auth_token"])) {
    if (file_exists($absolutePathToPhynx . "/ubiquitous/Sync/mSync.class.php")) {
        require_once $absolutePathToPhynx . "/ubiquitous/Sync/mSync.class.php";
    }
    $userToken = $_GET["auth_token"];
    if (!preg_match("/^[a-z0-9]+\$/i", $userToken)) {
        die("incorrect login information");
    }
    $user = mSync::getUserByToken($userToken);
    $E->login($user->A("username"), $user->A("SHApassword"));
} else {
    $E->login($_GET["username"], $_GET["password"]);
}
$calendar = mTodoGUI::getCalendarData($cutoffDatePast, $cutoffDateFuture);
$events = array();
foreach ($calendar->getEventsList() as $calendarEvent) {
    $events[] = $calendarEvent->toXCal();
}
echo xCalUtil::getXCal($events);
$E->cleanUp();