ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\CalDAV\Principal\User Class Reference

CalDAV principal. More...

+ Inheritance diagram for Sabre\CalDAV\Principal\User:
+ Collaboration diagram for Sabre\CalDAV\Principal\User:

Public Member Functions

 createFile ($name, $data=null)
 Creates a new file in the directory. More...
 
 createDirectory ($name)
 Creates a new subdirectory. More...
 
 getChild ($name)
 Returns a specific child node, referenced by its name. More...
 
 getChildren ()
 Returns an array with all the child nodes. More...
 
 childExists ($name)
 Returns whether or not the child node exists. More...
 
 getACL ()
 Returns a list of ACE's for this node. More...
 
- Public Member Functions inherited from Sabre\DAVACL\Principal
 __construct (PrincipalBackend\BackendInterface $principalBackend, array $principalProperties=[])
 Creates the principal object. More...
 
 getPrincipalUrl ()
 Returns the full principal url. More...
 
 getAlternateUriSet ()
 Returns a list of alternative urls for a principal. More...
 
 getGroupMemberSet ()
 Returns the list of group members. More...
 
 getGroupMembership ()
 Returns the list of groups this principal is member of. More...
 
 setGroupMemberSet (array $groupMembers)
 Sets a list of group members. More...
 
 getName ()
 Returns this principals name. More...
 
 getDisplayName ()
 Returns the name of the user. More...
 
 getProperties ($requestedProperties)
 Returns a list of properties. More...
 
 propPatch (DAV\PropPatch $propPatch)
 Updates properties on this node. More...
 
 getOwner ()
 Returns the owner principal. More...
 
- Public Member Functions inherited from Sabre\DAV\Node
 getLastModified ()
 Returns the last modification time as a unix timestamp. More...
 
 delete ()
 Deletes the current node. More...
 
 setName ($name)
 Renames the node. More...
 
 delete ()
 Deleted the current node. More...
 
 getName ()
 Returns the name of the node. More...
 
 setName ($name)
 Renames the node. More...
 
 getLastModified ()
 Returns the last modification time, as a unix timestamp. More...
 
 getAlternateUriSet ()
 Returns a list of alternative urls for a principal. More...
 
 getPrincipalUrl ()
 Returns the full principal url. More...
 
 getGroupMemberSet ()
 Returns the list of group members. More...
 
 getGroupMembership ()
 Returns the list of groups this principal is member of. More...
 
 setGroupMemberSet (array $principals)
 Sets a list of group members. More...
 
 getDisplayName ()
 Returns the displayname. More...
 
- Public Member Functions inherited from Sabre\DAV\IProperties
 propPatch (PropPatch $propPatch)
 Updates properties on this node. More...
 
 getProperties ($properties)
 Returns a list of properties for this nodes. More...
 
- Public Member Functions inherited from Sabre\DAVACL\IACL
 getOwner ()
 Returns the owner principal. More...
 
 getGroup ()
 Returns a group principal. More...
 
 getACL ()
 Returns a list of ACE's for this node. More...
 
 setACL (array $acl)
 Updates the ACL. More...
 
 getSupportedPrivilegeSet ()
 Returns the list of supported privileges for this node. More...
 
 createFile ($name, $data=null)
 Creates a new file in the directory. More...
 
 createDirectory ($name)
 Creates a new subdirectory. More...
 
 getChild ($name)
 Returns a specific child node, referenced by its name. More...
 
 getChildren ()
 Returns an array with all the child nodes. More...
 
 childExists ($name)
 Checks if a child-node with the specified name exists. More...
 

Additional Inherited Members

- Protected Attributes inherited from Sabre\DAVACL\Principal
 $principalProperties
 
 $principalBackend
 

Detailed Description

CalDAV principal.

This is a standard user-principal for CalDAV. This principal is also a collection and returns the caldav-proxy-read and caldav-proxy-write child principals.

Author
Evert Pot (http://evertpot.com/) @license http://sabre.io/license/ Modified BSD License

Definition at line 19 of file User.php.

Member Function Documentation

◆ childExists()

Sabre\CalDAV\Principal\User::childExists (   $name)

Returns whether or not the child node exists.

Parameters
string$name
Returns
bool

Implements Sabre\DAV\ICollection.

Definition at line 95 of file User.php.

95 {
96
97 try {
98 $this->getChild($name);
99 return true;
100 } catch (DAV\Exception\NotFound $e) {
101 return false;
102 }
103
104 }
getChild($name)
Returns a specific child node, referenced by its name.
Definition: User.php:54

References $name, and Sabre\CalDAV\Principal\User\getChild().

+ Here is the call graph for this function:

◆ createDirectory()

Sabre\CalDAV\Principal\User::createDirectory (   $name)

Creates a new subdirectory.

Parameters
string$name
Exceptions
DAV

Exception\Forbidden

Returns
void

Implements Sabre\DAV\ICollection.

Definition at line 42 of file User.php.

42 {
43
44 throw new DAV\Exception\Forbidden('Permission denied to create directory');
45
46 }

◆ createFile()

Sabre\CalDAV\Principal\User::createFile (   $name,
  $data = null 
)

Creates a new file in the directory.

Parameters
string$nameName of the file
resource$dataInitial payload, passed as a readable stream resource.
Exceptions
DAV

Exception\Forbidden

Returns
void

Implements Sabre\DAV\ICollection.

Definition at line 29 of file User.php.

29 {
30
31 throw new DAV\Exception\Forbidden('Permission denied to create file (filename ' . $name . ')');
32
33 }

References $name.

◆ getACL()

Sabre\CalDAV\Principal\User::getACL ( )

Returns a list of ACE's for this node.

Each ACE has the following properties:

  • 'privilege', a string such as {DAV:}read or {DAV:}write. These are currently the only supported privileges
  • 'principal', a url to the principal who owns the node
  • 'protected' (optional), indicating that this ACE is not allowed to be updated.
Returns
array

Implements Sabre\DAVACL\IACL.

Definition at line 118 of file User.php.

118 {
119
120 $acl = parent::getACL();
121 $acl[] = [
122 'privilege' => '{DAV:}read',
123 'principal' => $this->principalProperties['uri'] . '/calendar-proxy-read',
124 'protected' => true,
125 ];
126 $acl[] = [
127 'privilege' => '{DAV:}read',
128 'principal' => $this->principalProperties['uri'] . '/calendar-proxy-write',
129 'protected' => true,
130 ];
131 return $acl;
132
133 }

◆ getChild()

Sabre\CalDAV\Principal\User::getChild (   $name)

Returns a specific child node, referenced by its name.

Parameters
string$name
Returns
DAV\INode

Implements Sabre\DAV\ICollection.

Definition at line 54 of file User.php.

54 {
55
56 $principal = $this->principalBackend->getPrincipalByPath($this->getPrincipalURL() . '/' . $name);
57 if (!$principal) {
58 throw new DAV\Exception\NotFound('Node with name ' . $name . ' was not found');
59 }
60 if ($name === 'calendar-proxy-read')
61 return new ProxyRead($this->principalBackend, $this->principalProperties);
62
63 if ($name === 'calendar-proxy-write')
64 return new ProxyWrite($this->principalBackend, $this->principalProperties);
65
66 throw new DAV\Exception\NotFound('Node with name ' . $name . ' was not found');
67
68 }

References $name.

Referenced by Sabre\CalDAV\Principal\User\childExists().

+ Here is the caller graph for this function:

◆ getChildren()

Sabre\CalDAV\Principal\User::getChildren ( )

Returns an array with all the child nodes.

Returns
DAV\INode[]

Implements Sabre\DAV\ICollection.

Definition at line 75 of file User.php.

75 {
76
77 $r = [];
78 if ($this->principalBackend->getPrincipalByPath($this->getPrincipalURL() . '/calendar-proxy-read')) {
79 $r[] = new ProxyRead($this->principalBackend, $this->principalProperties);
80 }
81 if ($this->principalBackend->getPrincipalByPath($this->getPrincipalURL() . '/calendar-proxy-write')) {
82 $r[] = new ProxyWrite($this->principalBackend, $this->principalProperties);
83 }
84
85 return $r;
86
87 }
$r
Definition: example_031.php:79

References $r.


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