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...
 
- Public Member Functions inherited from Sabre\DAV\IProperties
 propPatch (PropPatch $propPatch)
 Updates properties on this node. More...
 
- Public Member Functions inherited from Sabre\DAVACL\IACL
 getGroup ()
 Returns a group principal. More...
 
 setACL (array $acl)
 Updates the ACL. More...
 
 getSupportedPrivilegeSet ()
 Returns the list of supported privileges for this node. 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/) 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.

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

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
+ Here is the call graph for this function:

◆ createDirectory()

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

Creates a new subdirectory.

Parameters
string$name
Exceptions
DAV

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

Implements Sabre\DAV\ICollection.

Definition at line 29 of file User.php.

References $name.

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

◆ 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

Implements Sabre\DAV\ICollection.

Definition at line 54 of file User.php.

References $name.

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

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  }
+ Here is the caller graph for this function:

◆ getChildren()

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

Returns an array with all the child nodes.

Returns
DAV[]

Implements Sabre\DAV\ICollection.

Definition at line 75 of file User.php.

References $r.

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

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