@@ -22,124 +22,124 @@ |
||
22 | 22 | */ |
23 | 23 | class CurrentUserPrivilegeSet implements Element, HtmlOutput |
24 | 24 | { |
25 | - /** |
|
26 | - * List of privileges. |
|
27 | - * |
|
28 | - * @var array |
|
29 | - */ |
|
30 | - private $privileges; |
|
25 | + /** |
|
26 | + * List of privileges. |
|
27 | + * |
|
28 | + * @var array |
|
29 | + */ |
|
30 | + private $privileges; |
|
31 | 31 | |
32 | - /** |
|
33 | - * Creates the object. |
|
34 | - * |
|
35 | - * Pass the privileges in clark-notation |
|
36 | - */ |
|
37 | - public function __construct(array $privileges) |
|
38 | - { |
|
39 | - $this->privileges = $privileges; |
|
40 | - } |
|
32 | + /** |
|
33 | + * Creates the object. |
|
34 | + * |
|
35 | + * Pass the privileges in clark-notation |
|
36 | + */ |
|
37 | + public function __construct(array $privileges) |
|
38 | + { |
|
39 | + $this->privileges = $privileges; |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * The xmlSerialize method is called during xml writing. |
|
44 | - * |
|
45 | - * Use the $writer argument to write its own xml serialization. |
|
46 | - * |
|
47 | - * An important note: do _not_ create a parent element. Any element |
|
48 | - * implementing XmlSerializable should only ever write what's considered |
|
49 | - * its 'inner xml'. |
|
50 | - * |
|
51 | - * The parent of the current element is responsible for writing a |
|
52 | - * containing element. |
|
53 | - * |
|
54 | - * This allows serializers to be re-used for different element names. |
|
55 | - * |
|
56 | - * If you are opening new elements, you must also close them again. |
|
57 | - */ |
|
58 | - public function xmlSerialize(Writer $writer) |
|
59 | - { |
|
60 | - foreach ($this->privileges as $privName) { |
|
61 | - $writer->startElement('{DAV:}privilege'); |
|
62 | - $writer->writeElement($privName); |
|
63 | - $writer->endElement(); |
|
64 | - } |
|
65 | - } |
|
42 | + /** |
|
43 | + * The xmlSerialize method is called during xml writing. |
|
44 | + * |
|
45 | + * Use the $writer argument to write its own xml serialization. |
|
46 | + * |
|
47 | + * An important note: do _not_ create a parent element. Any element |
|
48 | + * implementing XmlSerializable should only ever write what's considered |
|
49 | + * its 'inner xml'. |
|
50 | + * |
|
51 | + * The parent of the current element is responsible for writing a |
|
52 | + * containing element. |
|
53 | + * |
|
54 | + * This allows serializers to be re-used for different element names. |
|
55 | + * |
|
56 | + * If you are opening new elements, you must also close them again. |
|
57 | + */ |
|
58 | + public function xmlSerialize(Writer $writer) |
|
59 | + { |
|
60 | + foreach ($this->privileges as $privName) { |
|
61 | + $writer->startElement('{DAV:}privilege'); |
|
62 | + $writer->writeElement($privName); |
|
63 | + $writer->endElement(); |
|
64 | + } |
|
65 | + } |
|
66 | 66 | |
67 | - /** |
|
68 | - * Returns true or false, whether the specified principal appears in the |
|
69 | - * list. |
|
70 | - * |
|
71 | - * @param string $privilegeName |
|
72 | - * |
|
73 | - * @return bool |
|
74 | - */ |
|
75 | - public function has($privilegeName) |
|
76 | - { |
|
77 | - return in_array($privilegeName, $this->privileges); |
|
78 | - } |
|
67 | + /** |
|
68 | + * Returns true or false, whether the specified principal appears in the |
|
69 | + * list. |
|
70 | + * |
|
71 | + * @param string $privilegeName |
|
72 | + * |
|
73 | + * @return bool |
|
74 | + */ |
|
75 | + public function has($privilegeName) |
|
76 | + { |
|
77 | + return in_array($privilegeName, $this->privileges); |
|
78 | + } |
|
79 | 79 | |
80 | - /** |
|
81 | - * Returns the list of privileges. |
|
82 | - * |
|
83 | - * @return array |
|
84 | - */ |
|
85 | - public function getValue() |
|
86 | - { |
|
87 | - return $this->privileges; |
|
88 | - } |
|
80 | + /** |
|
81 | + * Returns the list of privileges. |
|
82 | + * |
|
83 | + * @return array |
|
84 | + */ |
|
85 | + public function getValue() |
|
86 | + { |
|
87 | + return $this->privileges; |
|
88 | + } |
|
89 | 89 | |
90 | - /** |
|
91 | - * The deserialize method is called during xml parsing. |
|
92 | - * |
|
93 | - * This method is called statically, this is because in theory this method |
|
94 | - * may be used as a type of constructor, or factory method. |
|
95 | - * |
|
96 | - * Often you want to return an instance of the current class, but you are |
|
97 | - * free to return other data as well. |
|
98 | - * |
|
99 | - * You are responsible for advancing the reader to the next element. Not |
|
100 | - * doing anything will result in a never-ending loop. |
|
101 | - * |
|
102 | - * If you just want to skip parsing for this element altogether, you can |
|
103 | - * just call $reader->next(); |
|
104 | - * |
|
105 | - * $reader->parseInnerTree() will parse the entire sub-tree, and advance to |
|
106 | - * the next element. |
|
107 | - * |
|
108 | - * @return mixed |
|
109 | - */ |
|
110 | - public static function xmlDeserialize(Reader $reader) |
|
111 | - { |
|
112 | - $result = []; |
|
90 | + /** |
|
91 | + * The deserialize method is called during xml parsing. |
|
92 | + * |
|
93 | + * This method is called statically, this is because in theory this method |
|
94 | + * may be used as a type of constructor, or factory method. |
|
95 | + * |
|
96 | + * Often you want to return an instance of the current class, but you are |
|
97 | + * free to return other data as well. |
|
98 | + * |
|
99 | + * You are responsible for advancing the reader to the next element. Not |
|
100 | + * doing anything will result in a never-ending loop. |
|
101 | + * |
|
102 | + * If you just want to skip parsing for this element altogether, you can |
|
103 | + * just call $reader->next(); |
|
104 | + * |
|
105 | + * $reader->parseInnerTree() will parse the entire sub-tree, and advance to |
|
106 | + * the next element. |
|
107 | + * |
|
108 | + * @return mixed |
|
109 | + */ |
|
110 | + public static function xmlDeserialize(Reader $reader) |
|
111 | + { |
|
112 | + $result = []; |
|
113 | 113 | |
114 | - $tree = $reader->parseInnerTree(['{DAV:}privilege' => 'Sabre\\Xml\\Element\\Elements']); |
|
115 | - foreach ($tree as $element) { |
|
116 | - if ('{DAV:}privilege' !== $element['name']) { |
|
117 | - continue; |
|
118 | - } |
|
119 | - $result[] = $element['value'][0]; |
|
120 | - } |
|
114 | + $tree = $reader->parseInnerTree(['{DAV:}privilege' => 'Sabre\\Xml\\Element\\Elements']); |
|
115 | + foreach ($tree as $element) { |
|
116 | + if ('{DAV:}privilege' !== $element['name']) { |
|
117 | + continue; |
|
118 | + } |
|
119 | + $result[] = $element['value'][0]; |
|
120 | + } |
|
121 | 121 | |
122 | - return new self($result); |
|
123 | - } |
|
122 | + return new self($result); |
|
123 | + } |
|
124 | 124 | |
125 | - /** |
|
126 | - * Generate html representation for this value. |
|
127 | - * |
|
128 | - * The html output is 100% trusted, and no effort is being made to sanitize |
|
129 | - * it. It's up to the implementor to sanitize user provided values. |
|
130 | - * |
|
131 | - * The output must be in UTF-8. |
|
132 | - * |
|
133 | - * The baseUri parameter is a url to the root of the application, and can |
|
134 | - * be used to construct local links. |
|
135 | - * |
|
136 | - * @return string |
|
137 | - */ |
|
138 | - public function toHtml(HtmlOutputHelper $html) |
|
139 | - { |
|
140 | - return implode( |
|
141 | - ', ', |
|
142 | - array_map([$html, 'xmlName'], $this->getValue()) |
|
143 | - ); |
|
144 | - } |
|
125 | + /** |
|
126 | + * Generate html representation for this value. |
|
127 | + * |
|
128 | + * The html output is 100% trusted, and no effort is being made to sanitize |
|
129 | + * it. It's up to the implementor to sanitize user provided values. |
|
130 | + * |
|
131 | + * The output must be in UTF-8. |
|
132 | + * |
|
133 | + * The baseUri parameter is a url to the root of the application, and can |
|
134 | + * be used to construct local links. |
|
135 | + * |
|
136 | + * @return string |
|
137 | + */ |
|
138 | + public function toHtml(HtmlOutputHelper $html) |
|
139 | + { |
|
140 | + return implode( |
|
141 | + ', ', |
|
142 | + array_map([$html, 'xmlName'], $this->getValue()) |
|
143 | + ); |
|
144 | + } |
|
145 | 145 | } |
@@ -18,77 +18,77 @@ |
||
18 | 18 | */ |
19 | 19 | trait ACLTrait |
20 | 20 | { |
21 | - /** |
|
22 | - * Returns the owner principal. |
|
23 | - * |
|
24 | - * This must be a url to a principal, or null if there's no owner |
|
25 | - * |
|
26 | - * @return string|null |
|
27 | - */ |
|
28 | - public function getOwner() |
|
29 | - { |
|
30 | - return null; |
|
31 | - } |
|
21 | + /** |
|
22 | + * Returns the owner principal. |
|
23 | + * |
|
24 | + * This must be a url to a principal, or null if there's no owner |
|
25 | + * |
|
26 | + * @return string|null |
|
27 | + */ |
|
28 | + public function getOwner() |
|
29 | + { |
|
30 | + return null; |
|
31 | + } |
|
32 | 32 | |
33 | - /** |
|
34 | - * Returns a group principal. |
|
35 | - * |
|
36 | - * This must be a url to a principal, or null if there's no owner |
|
37 | - * |
|
38 | - * @return string|null |
|
39 | - */ |
|
40 | - public function getGroup() |
|
41 | - { |
|
42 | - return null; |
|
43 | - } |
|
33 | + /** |
|
34 | + * Returns a group principal. |
|
35 | + * |
|
36 | + * This must be a url to a principal, or null if there's no owner |
|
37 | + * |
|
38 | + * @return string|null |
|
39 | + */ |
|
40 | + public function getGroup() |
|
41 | + { |
|
42 | + return null; |
|
43 | + } |
|
44 | 44 | |
45 | - /** |
|
46 | - * Returns a list of ACE's for this node. |
|
47 | - * |
|
48 | - * Each ACE has the following properties: |
|
49 | - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are |
|
50 | - * currently the only supported privileges |
|
51 | - * * 'principal', a url to the principal who owns the node |
|
52 | - * * 'protected' (optional), indicating that this ACE is not allowed to |
|
53 | - * be updated. |
|
54 | - * |
|
55 | - * @return array |
|
56 | - */ |
|
57 | - public function getACL() |
|
58 | - { |
|
59 | - return [ |
|
60 | - [ |
|
61 | - 'privilege' => '{DAV:}all', |
|
62 | - 'principal' => '{DAV:}owner', |
|
63 | - 'protected' => true, |
|
64 | - ], |
|
65 | - ]; |
|
66 | - } |
|
45 | + /** |
|
46 | + * Returns a list of ACE's for this node. |
|
47 | + * |
|
48 | + * Each ACE has the following properties: |
|
49 | + * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are |
|
50 | + * currently the only supported privileges |
|
51 | + * * 'principal', a url to the principal who owns the node |
|
52 | + * * 'protected' (optional), indicating that this ACE is not allowed to |
|
53 | + * be updated. |
|
54 | + * |
|
55 | + * @return array |
|
56 | + */ |
|
57 | + public function getACL() |
|
58 | + { |
|
59 | + return [ |
|
60 | + [ |
|
61 | + 'privilege' => '{DAV:}all', |
|
62 | + 'principal' => '{DAV:}owner', |
|
63 | + 'protected' => true, |
|
64 | + ], |
|
65 | + ]; |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * Updates the ACL. |
|
70 | - * |
|
71 | - * This method will receive a list of new ACE's as an array argument. |
|
72 | - */ |
|
73 | - public function setACL(array $acl) |
|
74 | - { |
|
75 | - throw new \Sabre\DAV\Exception\Forbidden('Setting ACL is not supported on this node'); |
|
76 | - } |
|
68 | + /** |
|
69 | + * Updates the ACL. |
|
70 | + * |
|
71 | + * This method will receive a list of new ACE's as an array argument. |
|
72 | + */ |
|
73 | + public function setACL(array $acl) |
|
74 | + { |
|
75 | + throw new \Sabre\DAV\Exception\Forbidden('Setting ACL is not supported on this node'); |
|
76 | + } |
|
77 | 77 | |
78 | - /** |
|
79 | - * Returns the list of supported privileges for this node. |
|
80 | - * |
|
81 | - * The returned data structure is a list of nested privileges. |
|
82 | - * See Sabre\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple |
|
83 | - * standard structure. |
|
84 | - * |
|
85 | - * If null is returned from this method, the default privilege set is used, |
|
86 | - * which is fine for most common usecases. |
|
87 | - * |
|
88 | - * @return array|null |
|
89 | - */ |
|
90 | - public function getSupportedPrivilegeSet() |
|
91 | - { |
|
92 | - return null; |
|
93 | - } |
|
78 | + /** |
|
79 | + * Returns the list of supported privileges for this node. |
|
80 | + * |
|
81 | + * The returned data structure is a list of nested privileges. |
|
82 | + * See Sabre\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple |
|
83 | + * standard structure. |
|
84 | + * |
|
85 | + * If null is returned from this method, the default privilege set is used, |
|
86 | + * which is fine for most common usecases. |
|
87 | + * |
|
88 | + * @return array|null |
|
89 | + */ |
|
90 | + public function getSupportedPrivilegeSet() |
|
91 | + { |
|
92 | + return null; |
|
93 | + } |
|
94 | 94 | } |
@@ -16,16 +16,16 @@ |
||
16 | 16 | */ |
17 | 17 | class AceConflict extends DAV\Exception\Conflict |
18 | 18 | { |
19 | - /** |
|
20 | - * Adds in extra information in the xml response. |
|
21 | - * |
|
22 | - * This method adds the {DAV:}no-ace-conflict element as defined in rfc3744 |
|
23 | - */ |
|
24 | - public function serialize(DAV\Server $server, \DOMElement $errorNode) |
|
25 | - { |
|
26 | - $doc = $errorNode->ownerDocument; |
|
19 | + /** |
|
20 | + * Adds in extra information in the xml response. |
|
21 | + * |
|
22 | + * This method adds the {DAV:}no-ace-conflict element as defined in rfc3744 |
|
23 | + */ |
|
24 | + public function serialize(DAV\Server $server, \DOMElement $errorNode) |
|
25 | + { |
|
26 | + $doc = $errorNode->ownerDocument; |
|
27 | 27 | |
28 | - $np = $doc->createElementNS('DAV:', 'd:no-ace-conflict'); |
|
29 | - $errorNode->appendChild($np); |
|
30 | - } |
|
28 | + $np = $doc->createElementNS('DAV:', 'd:no-ace-conflict'); |
|
29 | + $errorNode->appendChild($np); |
|
30 | + } |
|
31 | 31 | } |
@@ -16,16 +16,16 @@ |
||
16 | 16 | */ |
17 | 17 | class NotRecognizedPrincipal extends DAV\Exception\PreconditionFailed |
18 | 18 | { |
19 | - /** |
|
20 | - * Adds in extra information in the xml response. |
|
21 | - * |
|
22 | - * This method adds the {DAV:}recognized-principal element as defined in rfc3744 |
|
23 | - */ |
|
24 | - public function serialize(DAV\Server $server, \DOMElement $errorNode) |
|
25 | - { |
|
26 | - $doc = $errorNode->ownerDocument; |
|
19 | + /** |
|
20 | + * Adds in extra information in the xml response. |
|
21 | + * |
|
22 | + * This method adds the {DAV:}recognized-principal element as defined in rfc3744 |
|
23 | + */ |
|
24 | + public function serialize(DAV\Server $server, \DOMElement $errorNode) |
|
25 | + { |
|
26 | + $doc = $errorNode->ownerDocument; |
|
27 | 27 | |
28 | - $np = $doc->createElementNS('DAV:', 'd:recognized-principal'); |
|
29 | - $errorNode->appendChild($np); |
|
30 | - } |
|
28 | + $np = $doc->createElementNS('DAV:', 'd:recognized-principal'); |
|
29 | + $errorNode->appendChild($np); |
|
30 | + } |
|
31 | 31 | } |
@@ -16,16 +16,16 @@ |
||
16 | 16 | */ |
17 | 17 | class NoAbstract extends DAV\Exception\PreconditionFailed |
18 | 18 | { |
19 | - /** |
|
20 | - * Adds in extra information in the xml response. |
|
21 | - * |
|
22 | - * This method adds the {DAV:}no-abstract element as defined in rfc3744 |
|
23 | - */ |
|
24 | - public function serialize(DAV\Server $server, \DOMElement $errorNode) |
|
25 | - { |
|
26 | - $doc = $errorNode->ownerDocument; |
|
19 | + /** |
|
20 | + * Adds in extra information in the xml response. |
|
21 | + * |
|
22 | + * This method adds the {DAV:}no-abstract element as defined in rfc3744 |
|
23 | + */ |
|
24 | + public function serialize(DAV\Server $server, \DOMElement $errorNode) |
|
25 | + { |
|
26 | + $doc = $errorNode->ownerDocument; |
|
27 | 27 | |
28 | - $np = $doc->createElementNS('DAV:', 'd:no-abstract'); |
|
29 | - $errorNode->appendChild($np); |
|
30 | - } |
|
28 | + $np = $doc->createElementNS('DAV:', 'd:no-abstract'); |
|
29 | + $errorNode->appendChild($np); |
|
30 | + } |
|
31 | 31 | } |
@@ -16,16 +16,16 @@ |
||
16 | 16 | */ |
17 | 17 | class NotSupportedPrivilege extends DAV\Exception\PreconditionFailed |
18 | 18 | { |
19 | - /** |
|
20 | - * Adds in extra information in the xml response. |
|
21 | - * |
|
22 | - * This method adds the {DAV:}not-supported-privilege element as defined in rfc3744 |
|
23 | - */ |
|
24 | - public function serialize(DAV\Server $server, \DOMElement $errorNode) |
|
25 | - { |
|
26 | - $doc = $errorNode->ownerDocument; |
|
19 | + /** |
|
20 | + * Adds in extra information in the xml response. |
|
21 | + * |
|
22 | + * This method adds the {DAV:}not-supported-privilege element as defined in rfc3744 |
|
23 | + */ |
|
24 | + public function serialize(DAV\Server $server, \DOMElement $errorNode) |
|
25 | + { |
|
26 | + $doc = $errorNode->ownerDocument; |
|
27 | 27 | |
28 | - $np = $doc->createElementNS('DAV:', 'd:not-supported-privilege'); |
|
29 | - $errorNode->appendChild($np); |
|
30 | - } |
|
28 | + $np = $doc->createElementNS('DAV:', 'd:not-supported-privilege'); |
|
29 | + $errorNode->appendChild($np); |
|
30 | + } |
|
31 | 31 | } |
@@ -18,56 +18,56 @@ |
||
18 | 18 | */ |
19 | 19 | class NeedPrivileges extends DAV\Exception\Forbidden |
20 | 20 | { |
21 | - /** |
|
22 | - * The relevant uri. |
|
23 | - * |
|
24 | - * @var string |
|
25 | - */ |
|
26 | - protected $uri; |
|
21 | + /** |
|
22 | + * The relevant uri. |
|
23 | + * |
|
24 | + * @var string |
|
25 | + */ |
|
26 | + protected $uri; |
|
27 | 27 | |
28 | - /** |
|
29 | - * The privileges the user didn't have. |
|
30 | - * |
|
31 | - * @var array |
|
32 | - */ |
|
33 | - protected $privileges; |
|
28 | + /** |
|
29 | + * The privileges the user didn't have. |
|
30 | + * |
|
31 | + * @var array |
|
32 | + */ |
|
33 | + protected $privileges; |
|
34 | 34 | |
35 | - /** |
|
36 | - * Constructor. |
|
37 | - * |
|
38 | - * @param string $uri |
|
39 | - */ |
|
40 | - public function __construct($uri, array $privileges) |
|
41 | - { |
|
42 | - $this->uri = $uri; |
|
43 | - $this->privileges = $privileges; |
|
35 | + /** |
|
36 | + * Constructor. |
|
37 | + * |
|
38 | + * @param string $uri |
|
39 | + */ |
|
40 | + public function __construct($uri, array $privileges) |
|
41 | + { |
|
42 | + $this->uri = $uri; |
|
43 | + $this->privileges = $privileges; |
|
44 | 44 | |
45 | - parent::__construct('User did not have the required privileges ('.implode(',', $privileges).') for path "'.$uri.'"'); |
|
46 | - } |
|
45 | + parent::__construct('User did not have the required privileges ('.implode(',', $privileges).') for path "'.$uri.'"'); |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * Adds in extra information in the xml response. |
|
50 | - * |
|
51 | - * This method adds the {DAV:}need-privileges element as defined in rfc3744 |
|
52 | - */ |
|
53 | - public function serialize(DAV\Server $server, \DOMElement $errorNode) |
|
54 | - { |
|
55 | - $doc = $errorNode->ownerDocument; |
|
48 | + /** |
|
49 | + * Adds in extra information in the xml response. |
|
50 | + * |
|
51 | + * This method adds the {DAV:}need-privileges element as defined in rfc3744 |
|
52 | + */ |
|
53 | + public function serialize(DAV\Server $server, \DOMElement $errorNode) |
|
54 | + { |
|
55 | + $doc = $errorNode->ownerDocument; |
|
56 | 56 | |
57 | - $np = $doc->createElementNS('DAV:', 'd:need-privileges'); |
|
58 | - $errorNode->appendChild($np); |
|
57 | + $np = $doc->createElementNS('DAV:', 'd:need-privileges'); |
|
58 | + $errorNode->appendChild($np); |
|
59 | 59 | |
60 | - foreach ($this->privileges as $privilege) { |
|
61 | - $resource = $doc->createElementNS('DAV:', 'd:resource'); |
|
62 | - $np->appendChild($resource); |
|
60 | + foreach ($this->privileges as $privilege) { |
|
61 | + $resource = $doc->createElementNS('DAV:', 'd:resource'); |
|
62 | + $np->appendChild($resource); |
|
63 | 63 | |
64 | - $resource->appendChild($doc->createElementNS('DAV:', 'd:href', $server->getBaseUri().$this->uri)); |
|
64 | + $resource->appendChild($doc->createElementNS('DAV:', 'd:href', $server->getBaseUri().$this->uri)); |
|
65 | 65 | |
66 | - $priv = $doc->createElementNS('DAV:', 'd:privilege'); |
|
67 | - $resource->appendChild($priv); |
|
66 | + $priv = $doc->createElementNS('DAV:', 'd:privilege'); |
|
67 | + $resource->appendChild($priv); |
|
68 | 68 | |
69 | - preg_match('/^{([^}]*)}(.*)$/', $privilege, $privilegeParts); |
|
70 | - $priv->appendChild($doc->createElementNS($privilegeParts[1], 'd:'.$privilegeParts[2])); |
|
71 | - } |
|
72 | - } |
|
69 | + preg_match('/^{([^}]*)}(.*)$/', $privilege, $privilegeParts); |
|
70 | + $priv->appendChild($doc->createElementNS($privilegeParts[1], 'd:'.$privilegeParts[2])); |
|
71 | + } |
|
72 | + } |
|
73 | 73 | } |
@@ -18,47 +18,47 @@ |
||
18 | 18 | */ |
19 | 19 | interface IPrincipalCollection extends DAV\ICollection |
20 | 20 | { |
21 | - /** |
|
22 | - * This method is used to search for principals matching a set of |
|
23 | - * properties. |
|
24 | - * |
|
25 | - * This search is specifically used by RFC3744's principal-property-search |
|
26 | - * REPORT. You should at least allow searching on |
|
27 | - * http://sabredav.org/ns}email-address. |
|
28 | - * |
|
29 | - * The actual search should be a unicode-non-case-sensitive search. The |
|
30 | - * keys in searchProperties are the WebDAV property names, while the values |
|
31 | - * are the property values to search on. |
|
32 | - * |
|
33 | - * By default, if multiple properties are submitted to this method, the |
|
34 | - * various properties should be combined with 'AND'. If $test is set to |
|
35 | - * 'anyof', it should be combined using 'OR'. |
|
36 | - * |
|
37 | - * This method should simply return a list of 'child names', which may be |
|
38 | - * used to call $this->getChild in the future. |
|
39 | - * |
|
40 | - * @param string $test |
|
41 | - * |
|
42 | - * @return array |
|
43 | - */ |
|
44 | - public function searchPrincipals(array $searchProperties, $test = 'allof'); |
|
21 | + /** |
|
22 | + * This method is used to search for principals matching a set of |
|
23 | + * properties. |
|
24 | + * |
|
25 | + * This search is specifically used by RFC3744's principal-property-search |
|
26 | + * REPORT. You should at least allow searching on |
|
27 | + * http://sabredav.org/ns}email-address. |
|
28 | + * |
|
29 | + * The actual search should be a unicode-non-case-sensitive search. The |
|
30 | + * keys in searchProperties are the WebDAV property names, while the values |
|
31 | + * are the property values to search on. |
|
32 | + * |
|
33 | + * By default, if multiple properties are submitted to this method, the |
|
34 | + * various properties should be combined with 'AND'. If $test is set to |
|
35 | + * 'anyof', it should be combined using 'OR'. |
|
36 | + * |
|
37 | + * This method should simply return a list of 'child names', which may be |
|
38 | + * used to call $this->getChild in the future. |
|
39 | + * |
|
40 | + * @param string $test |
|
41 | + * |
|
42 | + * @return array |
|
43 | + */ |
|
44 | + public function searchPrincipals(array $searchProperties, $test = 'allof'); |
|
45 | 45 | |
46 | - /** |
|
47 | - * Finds a principal by its URI. |
|
48 | - * |
|
49 | - * This method may receive any type of uri, but mailto: addresses will be |
|
50 | - * the most common. |
|
51 | - * |
|
52 | - * Implementation of this API is optional. It is currently used by the |
|
53 | - * CalDAV system to find principals based on their email addresses. If this |
|
54 | - * API is not implemented, some features may not work correctly. |
|
55 | - * |
|
56 | - * This method must return a relative principal path, or null, if the |
|
57 | - * principal was not found or you refuse to find it. |
|
58 | - * |
|
59 | - * @param string $uri |
|
60 | - * |
|
61 | - * @return string |
|
62 | - */ |
|
63 | - public function findByUri($uri); |
|
46 | + /** |
|
47 | + * Finds a principal by its URI. |
|
48 | + * |
|
49 | + * This method may receive any type of uri, but mailto: addresses will be |
|
50 | + * the most common. |
|
51 | + * |
|
52 | + * Implementation of this API is optional. It is currently used by the |
|
53 | + * CalDAV system to find principals based on their email addresses. If this |
|
54 | + * API is not implemented, some features may not work correctly. |
|
55 | + * |
|
56 | + * This method must return a relative principal path, or null, if the |
|
57 | + * principal was not found or you refuse to find it. |
|
58 | + * |
|
59 | + * @param string $uri |
|
60 | + * |
|
61 | + * @return string |
|
62 | + */ |
|
63 | + public function findByUri($uri); |
|
64 | 64 | } |
@@ -16,14 +16,14 @@ |
||
16 | 16 | */ |
17 | 17 | interface CreatePrincipalSupport extends BackendInterface |
18 | 18 | { |
19 | - /** |
|
20 | - * Creates a new principal. |
|
21 | - * |
|
22 | - * This method receives a full path for the new principal. The mkCol object |
|
23 | - * contains any additional webdav properties specified during the creation |
|
24 | - * of the principal. |
|
25 | - * |
|
26 | - * @param string $path |
|
27 | - */ |
|
28 | - public function createPrincipal($path, MkCol $mkCol); |
|
19 | + /** |
|
20 | + * Creates a new principal. |
|
21 | + * |
|
22 | + * This method receives a full path for the new principal. The mkCol object |
|
23 | + * contains any additional webdav properties specified during the creation |
|
24 | + * of the principal. |
|
25 | + * |
|
26 | + * @param string $path |
|
27 | + */ |
|
28 | + public function createPrincipal($path, MkCol $mkCol); |
|
29 | 29 | } |