ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilMountPointDAV.php
Go to the documentation of this file.
1<?php
2
3use Sabre\CalDAV\Notifications\ICollection;
5use Sabre\DAV\Exception\NotFound;
6use Sabre\DAV\Exception\BadRequest;
7use Sabre\DAV\Exception\Forbidden;
8
24class ilMountPointDAV implements Sabre\DAV\ICollection
25{
27 protected $access;
28
30 protected $client_id;
31
33 protected $user_id;
34
36 protected $repo_helper;
37
39 protected $dav_helper;
40
42 {
43 global $DIC;
44
45 $this->repo_helper = $repo_helper;
46 $this->dav_helper = $dav_helper;
47 $this->client_id = $DIC['ilias']->getClientId();
48 $this->username = $DIC->user()->getFullname();
49 $this->user_id = $DIC->user()->getId();
50 }
51
57 public function getName()
58 {
59 return 'MountPoint';
60 }
61
70 public function getChildren()
71 {
72 if ($this->user_id != null && $this->user_id != ANONYMOUS_USER_ID) {
73 return array(new ilClientNodeDAV($this->client_id, $this->repo_helper, $this->dav_helper));
74 } else {
75 throw new Forbidden('Only for logged in users');
76 }
77 }
78
88 public function getChild($name)
89 {
90 if ($name == $this->client_id) {
91 return new ilClientNodeDAV($this->client_id, $this->repo_helper, $this->dav_helper);
92 }
93 throw new NotFound();
94 }
95
102 public function childExists($name)
103 {
104 if ($name == $this->client_id) {
105 return true;
106 }
107 return false;
108 }
109
115 public function getLastModified()
116 {
117 return strtotime('2000-01-01');
118 }
119
126 public function createDirectory($name)
127 {
128 throw new Forbidden("It is not possible to create a directory here");
129 }
130
139 public function createFile($name, $data = null)
140 {
141 throw new Forbidden("It is not possible to create a file here");
142 }
143
150 public function setName($name)
151 {
152 throw new Forbidden("It is not possible to change the name of the root");
153 }
154
160 public function delete()
161 {
162 throw new Forbidden("It is not possible to delete the root");
163 }
164}
An exception for terminatinating execution or to throw for unit testing.
This exception indicates that an UI component was accepted by the JF but is not backed by a real impl...
Class ilClientNodeDAV.
Class ilMountPointDAV.
createFile($name, $data=null)
It is not allowed (not even possible) to create a file here.
getChildren()
Returns client node if user exists and is not anonymous.
createDirectory($name)
It is not allowed (not even possible) to create a directory here.
__construct(ilWebDAVRepositoryHelper $repo_helper, ilWebDAVObjDAVHelper $dav_helper)
getName()
Return MountPoint as name.
childExists($name)
Check if given name matches the used Client ID.
getChild($name)
Returns Client Node if Client ID is correct.
getLastModified()
Return a default date as LastModified.
setName($name)
It is not possible to set the name for the MountPoint.
Class ilWebDAVObjDAVHelper.
Class ilWebDAVRepositoryHelper.
const ANONYMOUS_USER_ID
Definition: constants.php:25
global $DIC
Definition: goto.php:24
if($format !==null) $name
Definition: metadata.php:230
$data
Definition: storeScorm.php:23