ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
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';
22require_once("../artifacts/bootstrap_default.php");
23
24$path_info_components = explode('/', (string) $_SERVER['PATH_INFO']);
26$show_mount_instr = isset($_GET['mount-instructions']);
27
28try {
30 $_GET["client_id"] = $client_id;
33 entry_point("ILIAS Legacy Initialisation Adapter");
34} catch (InvalidArgumentException) {
35 header("HTTP/1.1 400 Bad Request");
36 header("X-WebDAV-Status: 400 Bad Request", true);
37 echo '<?xml version="1.0" encoding="utf-8"?>
38 <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
39 <s:sabredav-version>3.2.2</s:sabredav-version>
40 <s:exception>Sabre\DAV\Exception\BadRequest</s:exception>
41 <s:message/>
42 </d:error>';
43 exit;
44}
45
47 header("HTTP/1.1 403 Forbidden");
48 header("X-WebDAV-Status: 403 Forbidden", true);
49 echo '<html><body><h1>Sorry</h1>' .
50 '<p><b>Please enable the WebDAV plugin in the ILIAS Administration panel.</b></p>' .
51 '<p>You can only access this page, if WebDAV is enabled on this server.</p>' .
52 '</body></html>';
53 exit;
54}
55
57$webdav_dic->init($DIC);
58
60 $mount_gui = $webdav_dic->mountinstructions();
61 $mount_gui->renderMountInstructionsContent();
62} else {
63 try {
65 $server->handleRequest($post_array);
66 } catch (Throwable $e) {
67 header("HTTP/1.1 400 Bad Request");
68 header("X-WebDAV-Status: 400 Bad Request", true);
69 echo '<?xml version="1.0" encoding="utf-8"?>
70 <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
71 <s:sabredav-version>3.2.2</s:sabredav-version>
72 <s:exception>Sabre\DAV\Exception\BadRequest</s:exception>
73 <s:message>' . $e->getMessage() . '</s:message>
74 </d:error>';
75 exit;
76 }
77}
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
Definition: ilContext.php:36
static init(string $a_type)
Init context by type.
Definition: ilContext.php:52
exit
$_POST['cmd']
Definition: lti.php:27
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26
entry_point(string $name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: result1.php:21
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:25
$show_mount_instr
Definition: webdav.php:26
catch(InvalidArgumentException) if(!ilDAVActivationChecker::_isActive()) $webdav_dic
Definition: webdav.php:56
$path_info_components
Definition: webdav.php:24
$post_array
Definition: webdav.php:32