{
$a = get_app();
if (!isset($a->user["uid"]) || $a->user["uid"] == 0) {
- return Login::form();
+ return login();
}
$x = "";
$ret = wdcal_postEditPage("new", "", $a->user["uid"], $a->timezone, $a->get_baseurl() . "/dav/wdcal/");
if ($ret["ok"]) notice($ret["msg"]);
else info($ret["msg"]);
- goaway('dav/wdcal/');
+ goaway($a->get_baseurl() . "/dav/wdcal/");
}
$o .= wdcal_getNewPage();
return $o;
$ret = wdcal_postEditPage($a->argv[3], $a->user["uid"], $a->timezone, $a->get_baseurl() . "/dav/wdcal/");
if ($ret["ok"]) notice($ret["msg"]);
else info($ret["msg"]);
- goaway('dav/wdcal/');
+ goaway($a->get_baseurl() . "/dav/wdcal/");
}
$o .= wdcal_getEditPage($calendar_id, $a->argv[3]);
return $o;
} else {
$server = dav_create_server(true, true, false);
$cals = dav_get_current_user_calendars($server, DAV_ACL_READ);
- $x = wdcal_printCalendar($cals, [], $a->get_baseurl() . "/dav/wdcal/feed/", "week", 0, 200);
+ $x = wdcal_printCalendar($cals, array(), $a->get_baseurl() . "/dav/wdcal/feed/", "week", 0, 200);
}
}
} catch (DAVVersionMismatchException $e) {
q("UPDATE %s%snotifications SET `notified` = 1 WHERE `id` = %d", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, $not["id"]);
$event = q("SELECT * FROM %s%sjqcalendar WHERE `calendarobject_id` = %d", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, $not["calendarobject_id"]);
$calendar = q("SELECT * FROM %s%scalendars WHERE `id` = %d", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, $not["calendar_id"]);
- $users = [];
+ $users = array();
if (count($calendar) != 1 || count($event) == 0) continue;
switch ($calendar[0]["namespace"]) {
case CALDAV_NAMESPACE_PRIVATE:
case "email":
case "display": // @TODO implement "Display"
foreach ($users as $user) {
- $find = ["%to%", "%event%", "%url%"];
- $repl = [$user["username"], $event[0]["Summary"], $a->get_baseurl() . "/dav/wdcal/" . $calendar[0]["id"] . "/" . $not["calendarobject_id"] . "/"];
+ $find = array("%to%", "%event%", "%url%");
+ $repl = array($user["username"], $event[0]["Summary"], $a->get_baseurl() . "/dav/wdcal/" . $calendar[0]["id"] . "/" . $not["calendarobject_id"] . "/");
$text_text = str_replace($find, $repl, "Hi %to%!\n\nThe event \"%event%\" is about to begin:\n%url%");
$text_html = str_replace($find, $repl, "Hi %to%!<br>\n<br>\nThe event \"%event%\" is about to begin:<br>\n<a href='" . "%url%" . "'>%url%</a>");
- $params = [
+ $params = array(
'fromName' => FRIENDICA_PLATFORM,
'fromEmail' => L10n::t('noreply') . '@' . $a->get_hostname(),
'replyTo' => L10n::t('noreply') . '@' . $a->get_hostname(),
'htmlVersion' => $text_html,
'textVersion' => $text_text,
'additionalMailHeader' => "",
- ];
+ );
+ require_once('include/Emailer.php');
Emailer::send($params);
}
break;