ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
webdav.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
require_once __DIR__ .
'/../vendor/composer/vendor/autoload.php'
;
22
23
$path_info_components
= explode(
'/'
, (
string
)
$_SERVER
[
'PATH_INFO'
]);
24
$client_id
=
$path_info_components
[1];
25
$show_mount_instr
= isset(
$_GET
[
'mount-instructions'
]);
26
27
try
{
28
ilAuthFactory::setContext
(
ilAuthFactory::CONTEXT_HTTP
);
29
30
$_GET
[
"client_id"
] =
$client_id
;
31
$context
=
ilContext::CONTEXT_WEBDAV
;
32
ilContext::init
(
$context
);
33
$post_array
= $_POST;
34
ilInitialisation::initILIAS
();
35
}
catch
(
InvalidArgumentException
) {
36
header
(
"HTTP/1.1 400 Bad Request"
);
37
header
(
"X-WebDAV-Status: 400 Bad Request"
,
true
);
38
echo
'<?xml version="1.0" encoding="utf-8"?>
39
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
40
<s:sabredav-version>3.2.2</s:sabredav-version>
41
<s:exception>Sabre\DAV\Exception\BadRequest</s:exception>
42
<s:message/>
43
</d:error>'
;
44
exit
;
45
}
46
47
if
(!
ilDAVActivationChecker::_isActive
()) {
48
header
(
"HTTP/1.1 403 Forbidden"
);
49
header
(
"X-WebDAV-Status: 403 Forbidden"
,
true
);
50
echo
'<html><body><h1>Sorry</h1>'
.
51
'<p><b>Please enable the WebDAV plugin in the ILIAS Administration panel.</b></p>'
.
52
'<p>You can only access this page, if WebDAV is enabled on this server.</p>'
.
53
'</body></html>'
;
54
exit
;
55
}
56
57
$webdav_dic
=
new
ilWebDAVDIC
();
58
$webdav_dic
->init(
$DIC
);
59
60
if
(
$show_mount_instr
) {
61
$mount_gui =
$webdav_dic
->mountinstructions();
62
$mount_gui->renderMountInstructionsContent();
63
}
else
{
64
try
{
65
$server
=
new
ilWebDAVRequestHandler
(
$webdav_dic
);
66
$server
->handleRequest(
$post_array
);
67
}
catch
(
Throwable
$e
) {
68
header
(
"HTTP/1.1 400 Bad Request"
);
69
header
(
"X-WebDAV-Status: 400 Bad Request"
,
true
);
70
echo
'<?xml version="1.0" encoding="utf-8"?>
71
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
72
<s:sabredav-version>3.2.2</s:sabredav-version>
73
<s:exception>Sabre\DAV\Exception\BadRequest</s:exception>
74
<s:message>'
. $e->getMessage() .
'</s:message>
75
</d:error>'
;
76
exit
;
77
}
78
}
$_GET
$_GET["client_id"]
Definition:
webdav.php:30
ilAuthFactory\CONTEXT_HTTP
const int CONTEXT_HTTP
HTTP Auth used for WebDAV and CalDAV If a special handling for WebDAV or CalDAV is required overwrite...
Definition:
class.ilAuthFactory.php:33
$context
$context
Definition:
webdav.php:31
$post_array
$post_array
Definition:
webdav.php:33
ilWebDAVRequestHandler
Definition:
class.ilWebDAVRequestHandler.php:27
ilContext\CONTEXT_WEBDAV
const CONTEXT_WEBDAV
Definition:
class.ilContext.php:36
Vendor\Package\$e
$e
Definition:
example_cleaned.php:49
$path_info_components
$path_info_components
Definition:
webdav.php:23
ilDAVActivationChecker\_isActive
static _isActive()
Definition:
class.ilDAVActivationChecker.php:27
$show_mount_instr
$show_mount_instr
Definition:
webdav.php:25
ilWebDAVDIC
Definition:
class.ilWebDAVDIC.php:28
$client_id
$client_id
Definition:
webdav.php:24
ilInitialisation\initILIAS
static initILIAS()
ilias initialisation
Definition:
class.ilInitialisation.php:1145
$_SERVER
$_SERVER['HTTP_HOST']
Definition:
raiseError.php:26
$DIC
global $DIC
Definition:
shib_login.php:26
exit
exit
Definition:
dummy_client.php:21
ilAuthFactory\setContext
static setContext(int $a_context)
Definition:
class.ilAuthFactory.php:62
ilContext\init
static init(string $a_type)
Init context by type.
Definition:
class.ilContext.php:52
$webdav_dic
catch(InvalidArgumentException) if(!ilDAVActivationChecker::_isActive()) $webdav_dic
Definition:
webdav.php:57
InvalidArgumentException
$server
$server
Definition:
shib_login.php:28
ILIAS\UI\examples\Symbol\Glyph\Header\header
header()
expected output: > ILIAS shows the rendered Component.
Definition:
header.php:29
Throwable
components
ILIAS
WebDAV
resources
webdav.php
Generated on Sun Aug 31 2025 23:04:21 for ILIAS by
1.8.13 (using
Doxyfile
)