ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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']);
18 $show_mount_instr = isset($_GET['mount-instructions']);
19 
20 try{
21  // Set context for authentication
23 
24  // Launch ILIAS using the client id we have determined
25  $_GET["client_id"] = $client_id;
30  header("HTTP/1.1 400 Bad Request");
31  header("X-WebDAV-Status: 400 Bad Request", true);
32  echo '<?xml version="1.0" encoding="utf-8"?>
33  <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
34  <s:sabredav-version>3.2.2</s:sabredav-version>
35  <s:exception>Sabre\DAV\Exception\BadRequest</s:exception>
36  <s:message/>
37  </d:error>';
38  exit;
39 }
40 
42  header("HTTP/1.1 403 Forbidden");
43  header("X-WebDAV-Status: 403 Forbidden", true);
44  echo '<html><body><h1>Sorry</h1>' .
45  '<p><b>Please enable the WebDAV plugin in the ILIAS Administration panel.</b></p>' .
46  '<p>You can only access this page, if WebDAV is enabled on this server.</p>' .
47  '</body></html>';
48  exit;
49 }
50 
51 if ($show_mount_instr) {
52  // Show mount instructions page for WebDAV
55  $DIC->http()->request(),
56  $DIC->user()
57  );
58  $mount_instructions = $f->getMountInstructionsObject();
59 
60  $mount_gui = new ilWebDAVMountInstructionsGUI($mount_instructions);
61  $mount_gui->renderMountInstructionsContent();
62 } else {
63  // Launch the WebDAV Server
65  $server->handleRequest();
66 }
$_GET["client_id"]
Definition: webdav.php:25
exit
Definition: login.php:29
$context
Definition: webdav.php:26
const CONTEXT_WEBDAV
$path_info_components
Definition: webdav.php:16
static _isActive()
Static getter.
$show_mount_instr
Definition: webdav.php:18
$client_id
Definition: webdav.php:17
static initILIAS()
ilias initialisation
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
global $DIC
Definition: goto.php:24
static setContext($a_context)
set context
Class ilWebDAVMountInstructionsGUI.
static init($a_type)
Init context by type.
$server
Class ilWebDAVMountInstructionsfactory.