ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
webdav.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21require_once __DIR__ . '/../vendor/composer/vendor/autoload.php';
22
23$path_info_components = explode('/', (string) $_SERVER['PATH_INFO']);
25$show_mount_instr = isset($_GET['mount-instructions']);
26
27try {
29
30 $_GET["client_id"] = $client_id;
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
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
58$webdav_dic->init($DIC);
59
61 $mount_gui = $webdav_dic->mountinstructions();
62 $mount_gui->renderMountInstructionsContent();
63} else {
64 try {
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}
const int CONTEXT_HTTP
HTTP Auth used for WebDAV and CalDAV If a special handling for WebDAV or CalDAV is required overwrite...
static setContext(int $a_context)
const CONTEXT_WEBDAV
static init(string $a_type)
Init context by type.
static initILIAS()
ilias initialisation
exit
$_POST['cmd']
Definition: lti.php:27
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26
global $DIC
Definition: shib_login.php:26
$server
Definition: shib_login.php:28
$_GET["client_id"]
Definition: webdav.php:30
$client_id
Definition: webdav.php:24
$show_mount_instr
Definition: webdav.php:25
catch(InvalidArgumentException) if(!ilDAVActivationChecker::_isActive()) $webdav_dic
Definition: webdav.php:57
$path_info_components
Definition: webdav.php:23
$context
Definition: webdav.php:31
$post_array
Definition: webdav.php:33