ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMountPointDAV Class Reference

Class ilMountPointDAV. More...

+ Inheritance diagram for ilMountPointDAV:
+ Collaboration diagram for ilMountPointDAV:

Public Member Functions

 __construct (ilWebDAVRepositoryHelper $repo_helper, ilWebDAVObjDAVHelper $dav_helper)
 
 getName ()
 Return MountPoint as name. More...
 
 getChildren ()
 Returns client node if user exists and is not anonymous. More...
 
 getChild ($name)
 Returns Client Node if Client ID is correct. More...
 
 childExists ($name)
 Check if given name matches the used Client ID. More...
 
 getLastModified ()
 Return a default date as LastModified. More...
 
 createDirectory ($name)
 It is not allowed (not even possible) to create a directory here. More...
 
 createFile ($name, $data=null)
 It is not allowed (not even possible) to create a file here. More...
 
 setName ($name)
 It is not possible to set the name for the MountPoint. More...
 
 delete ()
 It is not possible to delete the MountPoint. More...
 

Protected Attributes

 $access
 
 $client_id
 
 $user_id
 
 $repo_helper
 
 $dav_helper
 

Detailed Description

Class ilMountPointDAV.

This class represents the absolut Root-Node on a WebDAV request. If for example following URL is called: https://ilias.de/webdav.php/client/ref_1234/folder this class represents the very first '/' slash after "webdav.php".

This kind of procedure is needed for the way how sabreDAV works

Author
Raphael Heer rapha.nosp@m.el.h.nosp@m.eer@h.nosp@m.slu..nosp@m.ch $Id$

Definition at line 24 of file class.ilMountPointDAV.php.

Constructor & Destructor Documentation

◆ __construct()

ilMountPointDAV::__construct ( ilWebDAVRepositoryHelper  $repo_helper,
ilWebDAVObjDAVHelper  $dav_helper 
)

Definition at line 41 of file class.ilMountPointDAV.php.

References $dav_helper, $DIC, and $repo_helper.

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  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ childExists()

ilMountPointDAV::childExists (   $name)

Check if given name matches the used Client ID.

Parameters
string$name
Returns
bool

Implements Sabre\DAV\ICollection.

Definition at line 102 of file class.ilMountPointDAV.php.

References $name.

103  {
104  if ($name == $this->client_id) {
105  return true;
106  }
107  return false;
108  }

◆ createDirectory()

ilMountPointDAV::createDirectory (   $name)

It is not allowed (not even possible) to create a directory here.

Parameters
string$name
Exceptions
Forbidden

Implements Sabre\DAV\ICollection.

Definition at line 126 of file class.ilMountPointDAV.php.

127  {
128  throw new Forbidden("It is not possible to create a directory here");
129  }

◆ createFile()

ilMountPointDAV::createFile (   $name,
  $data = null 
)

It is not allowed (not even possible) to create a file here.

Parameters
string$name
null$data
Returns
null|string|void
Exceptions
Forbidden

Implements Sabre\DAV\ICollection.

Definition at line 139 of file class.ilMountPointDAV.php.

140  {
141  throw new Forbidden("It is not possible to create a file here");
142  }

◆ delete()

ilMountPointDAV::delete ( )

It is not possible to delete the MountPoint.

Exceptions
Forbidden

Implements Sabre\DAV\INode.

Definition at line 160 of file class.ilMountPointDAV.php.

161  {
162  throw new Forbidden("It is not possible to delete the root");
163  }

◆ getChild()

ilMountPointDAV::getChild (   $name)

Returns Client Node if Client ID is correct.

No permissions to check here since Client node is not an object

Parameters
string$name
Returns
ilClientNodeDAV|
Exceptions
NotFound

Implements Sabre\DAV\ICollection.

Definition at line 88 of file class.ilMountPointDAV.php.

References $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  }
Class ilClientNodeDAV.

◆ getChildren()

ilMountPointDAV::getChildren ( )

Returns client node if user exists and is not anonymous.

There is no object permission to check

Returns
array|[]
Exceptions
Forbidden

Implements Sabre\DAV\ICollection.

Definition at line 70 of file class.ilMountPointDAV.php.

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  }
Class ilClientNodeDAV.

◆ getLastModified()

ilMountPointDAV::getLastModified ( )

Return a default date as LastModified.

Returns
false|int|null

Implements Sabre\DAV\INode.

Definition at line 115 of file class.ilMountPointDAV.php.

116  {
117  return strtotime('2000-01-01');
118  }

◆ getName()

ilMountPointDAV::getName ( )

Return MountPoint as name.

This method won't be called anyway

Returns
string

Implements Sabre\DAV\INode.

Definition at line 57 of file class.ilMountPointDAV.php.

58  {
59  return 'MountPoint';
60  }

◆ setName()

ilMountPointDAV::setName (   $name)

It is not possible to set the name for the MountPoint.

Parameters
string$name
Exceptions
Forbidden

Implements Sabre\DAV\INode.

Definition at line 150 of file class.ilMountPointDAV.php.

151  {
152  throw new Forbidden("It is not possible to change the name of the root");
153  }

Field Documentation

◆ $access

ilMountPointDAV::$access
protected

Definition at line 27 of file class.ilMountPointDAV.php.

◆ $client_id

ilMountPointDAV::$client_id
protected

Definition at line 30 of file class.ilMountPointDAV.php.

◆ $dav_helper

ilMountPointDAV::$dav_helper
protected

Definition at line 39 of file class.ilMountPointDAV.php.

Referenced by __construct().

◆ $repo_helper

ilMountPointDAV::$repo_helper
protected

Definition at line 36 of file class.ilMountPointDAV.php.

Referenced by __construct().

◆ $user_id

ilMountPointDAV::$user_id
protected

Definition at line 33 of file class.ilMountPointDAV.php.


The documentation for this class was generated from the following file: