ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.
15require_once("Services/Init/classes/class.ilInitialisation.php");
16$path_info_components = explode('/', $_SERVER['PATH_INFO']);
18$show_mount_instr = isset($_GET['mount-instructions']);
19
20try{
21 // Set context for authentication
23 // Launch ILIAS using the client id we have determined
24 $_GET["client_id"] = $client_id;
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
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
51 // Launch the WebDAV Server
53 $server->handleRequest();
54} else {
55 // Show mount isntructions page for WebDAV
56 $mount_gui = new ilWebDAVMountInstructionsGUI();
57 $mount_gui->showMountInstructionPage();
58}
exit
Definition: backend.php:16
An exception for terminatinating execution or to throw for unit testing.
static setContext($a_context)
set context
const CONTEXT_WEBDAV
static init($a_type)
Init context by type.
static initILIAS()
ilias initialisation
Class ilWebDAVMountInstructionsGUI.
$server
Definition: sabredav.php:48
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$_GET["client_id"]
Definition: webdav.php:24
$client_id
Definition: webdav.php:17
$show_mount_instr
Definition: webdav.php:18
$path_info_components
Definition: webdav.php:16
$context
Definition: webdav.php:25