Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1726753
ics.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
ics.php
View Options
<?php
/**
* DoukWiki DAVCal PlugIn - ICS support server
*/
if
(!
defined
(
'DOKU_INC'
))
define
(
'DOKU_INC'
,
dirname
(
__FILE__
).
'/../../../'
);
if
(!
defined
(
'DOKU_DISABLE_GZIP_OUTPUT'
))
define
(
'DOKU_DISABLE_GZIP_OUTPUT'
,
1
);
require_once
(
DOKU_INC
.
'inc/init.php'
);
session_write_close
();
//close session
global
$conf
;
if
(
$conf
[
'allowdebug'
])
dbglog
(
'---- DAVCAL ics.php init'
);
$path
=
explode
(
'/'
,
$_SERVER
[
'REQUEST_URI'
]);
$icsFile
=
end
(
$path
);
// Load the helper plugin
$hlp
=
null
;
$hlp
=&
plugin_load
(
'helper'
,
'davcal'
);
if
(
is_null
(
$hlp
))
{
if
(
$conf
[
'allowdebug'
])
dbglog
(
'Error loading helper plugin'
);
die
(
'Error loading helper plugin'
);
}
if
(
$hlp
->
getConfig
(
'disable_ics'
)
===
1
)
{
if
(
$conf
[
'allowdebug'
])
dbglog
(
'ICS synchronisation is disabled'
);
die
(
"ICS synchronisation is disabled"
);
}
// Retrieve calendar ID based on private URI
$calid
=
$hlp
->
getCalendarForPrivateURL
(
$icsFile
);
if
(
$calid
===
false
)
{
if
(
$conf
[
'allowdebug'
])
dbglog
(
'No calendar with this name known: '
.
$icsFile
);
die
(
"No calendar with this name known."
);
}
// Retrieve calendar contents and serve
$stream
=
$hlp
->
getCalendarAsICSFeed
(
$calid
);
header
(
"Content-Type: text/calendar"
);
header
(
"Content-Transfer-Encoding: Binary"
);
header
(
"Content-disposition: attachment; filename=
\"
calendar.ics
\"
"
);
echo
$stream
;
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Dec 5, 4:51 PM (1 d, 6 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
905764
Default Alt Text
ics.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment