ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
webdav.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
11
// Initialize
12
// -----------------------------------------------------
13
// Retrieve the client id from PATH_INFO
14
// Component 1 contains the ILIAS client_id.
15
require_once(
"Services/Init/classes/class.ilInitialisation.php"
);
16
$path_info_components
= explode(
'/'
,
$_SERVER
[
'PATH_INFO'
]);
17
$client_id
=
$path_info_components
[1];
18
$show_mount_instr
= isset(
$_GET
[
'mount-instructions'
]);
19
20
try
{
21
// Set context for authentication
22
ilAuthFactory::setContext
(
ilAuthFactory::CONTEXT_HTTP
);
23
// Launch ILIAS using the client id we have determined
24
$_GET
[
"client_id"
] =
$client_id
;
25
$context
=
ilContext::CONTEXT_WEBDAV
;
26
ilContext::init
(
$context
);
27
ilInitialisation::initILIAS
();
28
}
catch
(
InvalidArgumentException
$e) {
29
header(
"HTTP/1.1 400 Bad Request"
);
30
header(
"X-WebDAV-Status: 400 Bad Request"
,
true
);
31
echo
'<?xml version="1.0" encoding="utf-8"?>
32
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
33
<s:sabredav-version>3.2.2</s:sabredav-version>
34
<s:exception>Sabre\DAV\Exception\BadRequest</s:exception>
35
<s:message/>
36
</d:error>'
;
37
exit
;
38
}
39
40
if
(!
ilDAVActivationChecker::_isActive
()) {
41
header(
"HTTP/1.1 403 Forbidden"
);
42
header(
"X-WebDAV-Status: 403 Forbidden"
,
true
);
43
echo
'<html><body><h1>Sorry</h1>'
.
44
'<p><b>Please enable the WebDAV plugin in the ILIAS Administration panel.</b></p>'
.
45
'<p>You can only access this page, if WebDAV is enabled on this server.</p>'
.
46
'</body></html>'
;
47
exit
;
48
}
49
50
if
(!
$show_mount_instr
) {
51
// Launch the WebDAV Server
52
$server
=
ilWebDAVRequestHandler::getInstance
();
53
$server
->handleRequest();
54
}
else
{
55
// Show mount isntructions page for WebDAV
56
$mount_gui =
new
ilWebDAVMountInstructionsGUI
();
57
$mount_gui->showMountInstructionPage();
58
}
$_GET
$_GET["client_id"]
Definition:
webdav.php:24
$_SERVER
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
Definition:
tcpdf_autoconfig.php:54
$context
$context
Definition:
webdav.php:25
ilAuthFactory\CONTEXT_HTTP
const CONTEXT_HTTP
Definition:
class.ilAuthFactory.php:29
ilContext\CONTEXT_WEBDAV
const CONTEXT_WEBDAV
Definition:
class.ilContext.php:25
$path_info_components
$path_info_components
Definition:
webdav.php:16
ilDAVActivationChecker\_isActive
static _isActive()
Static getter.
Definition:
class.ilDAVActivationChecker.php:17
$show_mount_instr
$show_mount_instr
Definition:
webdav.php:18
$server
$server
Definition:
sabredav.php:48
$client_id
$client_id
Definition:
webdav.php:17
ilInitialisation\initILIAS
static initILIAS()
ilias initialisation
Definition:
class.ilInitialisation.php:996
ilAuthFactory\setContext
static setContext($a_context)
set context
Definition:
class.ilAuthFactory.php:95
ilWebDAVMountInstructionsGUI
Class ilWebDAVMountInstructionsGUI.
Definition:
class.ilWebDAVMountInstructionsGUI.php:14
echo
ilContext\init
static init($a_type)
Init context by type.
Definition:
class.ilContext.php:45
exit
exit
Definition:
backend.php:16
php
InvalidArgumentException
ilWebDAVRequestHandler\getInstance
static getInstance()
Definition:
class.ilWebDAVRequestHandler.php:37
webdav.php
Generated on Thu Feb 27 2025 19:02:12 for ILIAS by
1.8.13 (using
Doxyfile
)