@@ -63,7 +63,7 @@ |
||
| 63 | 63 | private function setupUserFs($userId) { |
| 64 | 64 | \OC_Util::setupFS($userId); |
| 65 | 65 | $this->session->close(); |
| 66 | - return $this->principalPrefix . $userId; |
|
| 66 | + return $this->principalPrefix.$userId; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -16,57 +16,57 @@ |
||
| 16 | 16 | use Sabre\HTTP\ResponseInterface; |
| 17 | 17 | |
| 18 | 18 | class BearerAuth extends AbstractBearer { |
| 19 | - public function __construct( |
|
| 20 | - private IUserSession $userSession, |
|
| 21 | - private ISession $session, |
|
| 22 | - private IRequest $request, |
|
| 23 | - private IConfig $config, |
|
| 24 | - private string $principalPrefix = 'principals/users/', |
|
| 25 | - ) { |
|
| 26 | - // setup realm |
|
| 27 | - $defaults = new Defaults(); |
|
| 28 | - $this->realm = $defaults->getName() ?: 'Nextcloud'; |
|
| 29 | - } |
|
| 19 | + public function __construct( |
|
| 20 | + private IUserSession $userSession, |
|
| 21 | + private ISession $session, |
|
| 22 | + private IRequest $request, |
|
| 23 | + private IConfig $config, |
|
| 24 | + private string $principalPrefix = 'principals/users/', |
|
| 25 | + ) { |
|
| 26 | + // setup realm |
|
| 27 | + $defaults = new Defaults(); |
|
| 28 | + $this->realm = $defaults->getName() ?: 'Nextcloud'; |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - private function setupUserFs($userId) { |
|
| 32 | - \OC_Util::setupFS($userId); |
|
| 33 | - $this->session->close(); |
|
| 34 | - return $this->principalPrefix . $userId; |
|
| 35 | - } |
|
| 31 | + private function setupUserFs($userId) { |
|
| 32 | + \OC_Util::setupFS($userId); |
|
| 33 | + $this->session->close(); |
|
| 34 | + return $this->principalPrefix . $userId; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * {@inheritdoc} |
|
| 39 | - */ |
|
| 40 | - public function validateBearerToken($bearerToken) { |
|
| 41 | - \OC_Util::setupFS(); |
|
| 37 | + /** |
|
| 38 | + * {@inheritdoc} |
|
| 39 | + */ |
|
| 40 | + public function validateBearerToken($bearerToken) { |
|
| 41 | + \OC_Util::setupFS(); |
|
| 42 | 42 | |
| 43 | - if (!$this->userSession->isLoggedIn()) { |
|
| 44 | - $this->userSession->tryTokenLogin($this->request); |
|
| 45 | - } |
|
| 46 | - if ($this->userSession->isLoggedIn()) { |
|
| 47 | - return $this->setupUserFs($this->userSession->getUser()->getUID()); |
|
| 48 | - } |
|
| 43 | + if (!$this->userSession->isLoggedIn()) { |
|
| 44 | + $this->userSession->tryTokenLogin($this->request); |
|
| 45 | + } |
|
| 46 | + if ($this->userSession->isLoggedIn()) { |
|
| 47 | + return $this->setupUserFs($this->userSession->getUser()->getUID()); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - return false; |
|
| 51 | - } |
|
| 50 | + return false; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * \Sabre\DAV\Auth\Backend\AbstractBearer::challenge sets an WWW-Authenticate |
|
| 55 | - * header which some DAV clients can't handle. Thus we override this function |
|
| 56 | - * and make it simply return a 401. |
|
| 57 | - * |
|
| 58 | - * @param RequestInterface $request |
|
| 59 | - * @param ResponseInterface $response |
|
| 60 | - */ |
|
| 61 | - public function challenge(RequestInterface $request, ResponseInterface $response): void { |
|
| 62 | - // Legacy ownCloud clients still authenticate via OAuth2 |
|
| 63 | - $enableOcClients = $this->config->getSystemValueBool('oauth2.enable_oc_clients', false); |
|
| 64 | - $userAgent = $request->getHeader('User-Agent'); |
|
| 65 | - if ($enableOcClients && $userAgent !== null && str_contains($userAgent, 'mirall')) { |
|
| 66 | - parent::challenge($request, $response); |
|
| 67 | - return; |
|
| 68 | - } |
|
| 53 | + /** |
|
| 54 | + * \Sabre\DAV\Auth\Backend\AbstractBearer::challenge sets an WWW-Authenticate |
|
| 55 | + * header which some DAV clients can't handle. Thus we override this function |
|
| 56 | + * and make it simply return a 401. |
|
| 57 | + * |
|
| 58 | + * @param RequestInterface $request |
|
| 59 | + * @param ResponseInterface $response |
|
| 60 | + */ |
|
| 61 | + public function challenge(RequestInterface $request, ResponseInterface $response): void { |
|
| 62 | + // Legacy ownCloud clients still authenticate via OAuth2 |
|
| 63 | + $enableOcClients = $this->config->getSystemValueBool('oauth2.enable_oc_clients', false); |
|
| 64 | + $userAgent = $request->getHeader('User-Agent'); |
|
| 65 | + if ($enableOcClients && $userAgent !== null && str_contains($userAgent, 'mirall')) { |
|
| 66 | + parent::challenge($request, $response); |
|
| 67 | + return; |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - $response->setStatus(Http::STATUS_UNAUTHORIZED); |
|
| 71 | - } |
|
| 70 | + $response->setStatus(Http::STATUS_UNAUTHORIZED); |
|
| 71 | + } |
|
| 72 | 72 | } |
@@ -31,12 +31,12 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | class UnsupportedMediaType extends \Sabre\DAV\Exception { |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Returns the HTTP status code for this exception |
|
| 36 | - * |
|
| 37 | - * @return int |
|
| 38 | - */ |
|
| 39 | - public function getHTTPCode() { |
|
| 40 | - return 415; |
|
| 41 | - } |
|
| 34 | + /** |
|
| 35 | + * Returns the HTTP status code for this exception |
|
| 36 | + * |
|
| 37 | + * @return int |
|
| 38 | + */ |
|
| 39 | + public function getHTTPCode() { |
|
| 40 | + return 415; |
|
| 41 | + } |
|
| 42 | 42 | } |
@@ -31,12 +31,12 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | class EntityTooLarge extends \Sabre\DAV\Exception { |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Returns the HTTP status code for this exception |
|
| 36 | - * |
|
| 37 | - * @return int |
|
| 38 | - */ |
|
| 39 | - public function getHTTPCode() { |
|
| 40 | - return 413; |
|
| 41 | - } |
|
| 34 | + /** |
|
| 35 | + * Returns the HTTP status code for this exception |
|
| 36 | + * |
|
| 37 | + * @return int |
|
| 38 | + */ |
|
| 39 | + public function getHTTPCode() { |
|
| 40 | + return 413; |
|
| 41 | + } |
|
| 42 | 42 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | return null; |
| 89 | 89 | } |
| 90 | 90 | foreach ($tree as $elem) { |
| 91 | - if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}tag') { |
|
| 91 | + if ($elem['name'] === '{'.self::NS_OWNCLOUD.'}tag') { |
|
| 92 | 92 | $tags[] = $elem['value']; |
| 93 | 93 | } |
| 94 | 94 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function xmlSerialize(Writer $writer) { |
| 118 | 118 | foreach ($this->tags as $tag) { |
| 119 | - $writer->writeElement('{' . self::NS_OWNCLOUD . '}tag', $tag); |
|
| 119 | + $writer->writeElement('{'.self::NS_OWNCLOUD.'}tag', $tag); |
|
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | } |
@@ -17,86 +17,86 @@ |
||
| 17 | 17 | * This property contains multiple "tag" elements, each containing a tag name. |
| 18 | 18 | */ |
| 19 | 19 | class TagList implements Element { |
| 20 | - public const NS_OWNCLOUD = 'http://owncloud.org/ns'; |
|
| 20 | + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * @param array $tags |
|
| 24 | - */ |
|
| 25 | - public function __construct( |
|
| 26 | - /** |
|
| 27 | - * tags |
|
| 28 | - */ |
|
| 29 | - private array $tags, |
|
| 30 | - ) { |
|
| 31 | - } |
|
| 22 | + /** |
|
| 23 | + * @param array $tags |
|
| 24 | + */ |
|
| 25 | + public function __construct( |
|
| 26 | + /** |
|
| 27 | + * tags |
|
| 28 | + */ |
|
| 29 | + private array $tags, |
|
| 30 | + ) { |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Returns the tags |
|
| 35 | - * |
|
| 36 | - * @return array |
|
| 37 | - */ |
|
| 38 | - public function getTags() { |
|
| 39 | - return $this->tags; |
|
| 40 | - } |
|
| 33 | + /** |
|
| 34 | + * Returns the tags |
|
| 35 | + * |
|
| 36 | + * @return array |
|
| 37 | + */ |
|
| 38 | + public function getTags() { |
|
| 39 | + return $this->tags; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * The deserialize method is called during xml parsing. |
|
| 44 | - * |
|
| 45 | - * This method is called statictly, this is because in theory this method |
|
| 46 | - * may be used as a type of constructor, or factory method. |
|
| 47 | - * |
|
| 48 | - * Often you want to return an instance of the current class, but you are |
|
| 49 | - * free to return other data as well. |
|
| 50 | - * |
|
| 51 | - * You are responsible for advancing the reader to the next element. Not |
|
| 52 | - * doing anything will result in a never-ending loop. |
|
| 53 | - * |
|
| 54 | - * If you just want to skip parsing for this element altogether, you can |
|
| 55 | - * just call $reader->next(); |
|
| 56 | - * |
|
| 57 | - * $reader->parseInnerTree() will parse the entire sub-tree, and advance to |
|
| 58 | - * the next element. |
|
| 59 | - * |
|
| 60 | - * @param Reader $reader |
|
| 61 | - * @return mixed |
|
| 62 | - */ |
|
| 63 | - public static function xmlDeserialize(Reader $reader) { |
|
| 64 | - $tags = []; |
|
| 42 | + /** |
|
| 43 | + * The deserialize method is called during xml parsing. |
|
| 44 | + * |
|
| 45 | + * This method is called statictly, this is because in theory this method |
|
| 46 | + * may be used as a type of constructor, or factory method. |
|
| 47 | + * |
|
| 48 | + * Often you want to return an instance of the current class, but you are |
|
| 49 | + * free to return other data as well. |
|
| 50 | + * |
|
| 51 | + * You are responsible for advancing the reader to the next element. Not |
|
| 52 | + * doing anything will result in a never-ending loop. |
|
| 53 | + * |
|
| 54 | + * If you just want to skip parsing for this element altogether, you can |
|
| 55 | + * just call $reader->next(); |
|
| 56 | + * |
|
| 57 | + * $reader->parseInnerTree() will parse the entire sub-tree, and advance to |
|
| 58 | + * the next element. |
|
| 59 | + * |
|
| 60 | + * @param Reader $reader |
|
| 61 | + * @return mixed |
|
| 62 | + */ |
|
| 63 | + public static function xmlDeserialize(Reader $reader) { |
|
| 64 | + $tags = []; |
|
| 65 | 65 | |
| 66 | - $tree = $reader->parseInnerTree(); |
|
| 67 | - if ($tree === null) { |
|
| 68 | - return null; |
|
| 69 | - } |
|
| 70 | - foreach ($tree as $elem) { |
|
| 71 | - if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}tag') { |
|
| 72 | - $tags[] = $elem['value']; |
|
| 73 | - } |
|
| 74 | - } |
|
| 75 | - return new self($tags); |
|
| 76 | - } |
|
| 66 | + $tree = $reader->parseInnerTree(); |
|
| 67 | + if ($tree === null) { |
|
| 68 | + return null; |
|
| 69 | + } |
|
| 70 | + foreach ($tree as $elem) { |
|
| 71 | + if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}tag') { |
|
| 72 | + $tags[] = $elem['value']; |
|
| 73 | + } |
|
| 74 | + } |
|
| 75 | + return new self($tags); |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | - /** |
|
| 79 | - * The xmlSerialize method is called during xml writing. |
|
| 80 | - * |
|
| 81 | - * Use the $writer argument to write its own xml serialization. |
|
| 82 | - * |
|
| 83 | - * An important note: do _not_ create a parent element. Any element |
|
| 84 | - * implementing XmlSerializble should only ever write what's considered |
|
| 85 | - * its 'inner xml'. |
|
| 86 | - * |
|
| 87 | - * The parent of the current element is responsible for writing a |
|
| 88 | - * containing element. |
|
| 89 | - * |
|
| 90 | - * This allows serializers to be re-used for different element names. |
|
| 91 | - * |
|
| 92 | - * If you are opening new elements, you must also close them again. |
|
| 93 | - * |
|
| 94 | - * @param Writer $writer |
|
| 95 | - * @return void |
|
| 96 | - */ |
|
| 97 | - public function xmlSerialize(Writer $writer) { |
|
| 98 | - foreach ($this->tags as $tag) { |
|
| 99 | - $writer->writeElement('{' . self::NS_OWNCLOUD . '}tag', $tag); |
|
| 100 | - } |
|
| 101 | - } |
|
| 78 | + /** |
|
| 79 | + * The xmlSerialize method is called during xml writing. |
|
| 80 | + * |
|
| 81 | + * Use the $writer argument to write its own xml serialization. |
|
| 82 | + * |
|
| 83 | + * An important note: do _not_ create a parent element. Any element |
|
| 84 | + * implementing XmlSerializble should only ever write what's considered |
|
| 85 | + * its 'inner xml'. |
|
| 86 | + * |
|
| 87 | + * The parent of the current element is responsible for writing a |
|
| 88 | + * containing element. |
|
| 89 | + * |
|
| 90 | + * This allows serializers to be re-used for different element names. |
|
| 91 | + * |
|
| 92 | + * If you are opening new elements, you must also close them again. |
|
| 93 | + * |
|
| 94 | + * @param Writer $writer |
|
| 95 | + * @return void |
|
| 96 | + */ |
|
| 97 | + public function xmlSerialize(Writer $writer) { |
|
| 98 | + foreach ($this->tags as $tag) { |
|
| 99 | + $writer->writeElement('{' . self::NS_OWNCLOUD . '}tag', $tag); |
|
| 100 | + } |
|
| 101 | + } |
|
| 102 | 102 | } |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | * @return false |
| 59 | 59 | */ |
| 60 | 60 | public function httpGet(RequestInterface $request, ResponseInterface $response) { |
| 61 | - $string = 'This is the WebDAV interface. It can only be accessed by ' . |
|
| 61 | + $string = 'This is the WebDAV interface. It can only be accessed by '. |
|
| 62 | 62 | 'WebDAV clients such as the Nextcloud desktop sync client.'; |
| 63 | 63 | $stream = fopen('php://memory', 'r+'); |
| 64 | 64 | fwrite($stream, $string); |
@@ -26,32 +26,32 @@ |
||
| 26 | 26 | * @package OCA\DAV\Connector\Sabre |
| 27 | 27 | */ |
| 28 | 28 | class DummyGetResponsePlugin extends \Sabre\DAV\ServerPlugin { |
| 29 | - protected ?Server $server = null; |
|
| 29 | + protected ?Server $server = null; |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * @param \Sabre\DAV\Server $server |
|
| 33 | - * @return void |
|
| 34 | - */ |
|
| 35 | - public function initialize(\Sabre\DAV\Server $server) { |
|
| 36 | - $this->server = $server; |
|
| 37 | - $this->server->on('method:GET', [$this, 'httpGet'], 200); |
|
| 38 | - } |
|
| 31 | + /** |
|
| 32 | + * @param \Sabre\DAV\Server $server |
|
| 33 | + * @return void |
|
| 34 | + */ |
|
| 35 | + public function initialize(\Sabre\DAV\Server $server) { |
|
| 36 | + $this->server = $server; |
|
| 37 | + $this->server->on('method:GET', [$this, 'httpGet'], 200); |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @param RequestInterface $request |
|
| 42 | - * @param ResponseInterface $response |
|
| 43 | - * @return false |
|
| 44 | - */ |
|
| 45 | - public function httpGet(RequestInterface $request, ResponseInterface $response) { |
|
| 46 | - $string = 'This is the WebDAV interface. It can only be accessed by ' . |
|
| 47 | - 'WebDAV clients such as the Nextcloud desktop sync client.'; |
|
| 48 | - $stream = fopen('php://memory', 'r+'); |
|
| 49 | - fwrite($stream, $string); |
|
| 50 | - rewind($stream); |
|
| 40 | + /** |
|
| 41 | + * @param RequestInterface $request |
|
| 42 | + * @param ResponseInterface $response |
|
| 43 | + * @return false |
|
| 44 | + */ |
|
| 45 | + public function httpGet(RequestInterface $request, ResponseInterface $response) { |
|
| 46 | + $string = 'This is the WebDAV interface. It can only be accessed by ' . |
|
| 47 | + 'WebDAV clients such as the Nextcloud desktop sync client.'; |
|
| 48 | + $stream = fopen('php://memory', 'r+'); |
|
| 49 | + fwrite($stream, $string); |
|
| 50 | + rewind($stream); |
|
| 51 | 51 | |
| 52 | - $response->setStatus(Http::STATUS_OK); |
|
| 53 | - $response->setBody($stream); |
|
| 52 | + $response->setStatus(Http::STATUS_OK); |
|
| 53 | + $response->setBody($stream); |
|
| 54 | 54 | |
| 55 | - return false; |
|
| 56 | - } |
|
| 55 | + return false; |
|
| 56 | + } |
|
| 57 | 57 | } |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | */ |
| 65 | 65 | public function xmlSerialize(Writer $writer) { |
| 66 | 66 | foreach ($this->checksums as $checksum) { |
| 67 | - $writer->writeElement('{' . self::NS_OWNCLOUD . '}checksum', $checksum); |
|
| 67 | + $writer->writeElement('{'.self::NS_OWNCLOUD.'}checksum', $checksum); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | } |
@@ -32,37 +32,37 @@ |
||
| 32 | 32 | * checksum name. |
| 33 | 33 | */ |
| 34 | 34 | class ChecksumList implements XmlSerializable { |
| 35 | - public const NS_OWNCLOUD = 'http://owncloud.org/ns'; |
|
| 35 | + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; |
|
| 36 | 36 | |
| 37 | - /** @var string[] of TYPE:CHECKSUM */ |
|
| 38 | - private array $checksums; |
|
| 37 | + /** @var string[] of TYPE:CHECKSUM */ |
|
| 38 | + private array $checksums; |
|
| 39 | 39 | |
| 40 | - public function __construct(string $checksum) { |
|
| 41 | - $this->checksums = explode(' ', $checksum); |
|
| 42 | - } |
|
| 40 | + public function __construct(string $checksum) { |
|
| 41 | + $this->checksums = explode(' ', $checksum); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * The xmlSerialize method is called during xml writing. |
|
| 46 | - * |
|
| 47 | - * Use the $writer argument to write its own xml serialization. |
|
| 48 | - * |
|
| 49 | - * An important note: do _not_ create a parent element. Any element |
|
| 50 | - * implementing XmlSerializble should only ever write what's considered |
|
| 51 | - * its 'inner xml'. |
|
| 52 | - * |
|
| 53 | - * The parent of the current element is responsible for writing a |
|
| 54 | - * containing element. |
|
| 55 | - * |
|
| 56 | - * This allows serializers to be re-used for different element names. |
|
| 57 | - * |
|
| 58 | - * If you are opening new elements, you must also close them again. |
|
| 59 | - * |
|
| 60 | - * @param Writer $writer |
|
| 61 | - * @return void |
|
| 62 | - */ |
|
| 63 | - public function xmlSerialize(Writer $writer) { |
|
| 64 | - foreach ($this->checksums as $checksum) { |
|
| 65 | - $writer->writeElement('{' . self::NS_OWNCLOUD . '}checksum', $checksum); |
|
| 66 | - } |
|
| 67 | - } |
|
| 44 | + /** |
|
| 45 | + * The xmlSerialize method is called during xml writing. |
|
| 46 | + * |
|
| 47 | + * Use the $writer argument to write its own xml serialization. |
|
| 48 | + * |
|
| 49 | + * An important note: do _not_ create a parent element. Any element |
|
| 50 | + * implementing XmlSerializble should only ever write what's considered |
|
| 51 | + * its 'inner xml'. |
|
| 52 | + * |
|
| 53 | + * The parent of the current element is responsible for writing a |
|
| 54 | + * containing element. |
|
| 55 | + * |
|
| 56 | + * This allows serializers to be re-used for different element names. |
|
| 57 | + * |
|
| 58 | + * If you are opening new elements, you must also close them again. |
|
| 59 | + * |
|
| 60 | + * @param Writer $writer |
|
| 61 | + * @return void |
|
| 62 | + */ |
|
| 63 | + public function xmlSerialize(Writer $writer) { |
|
| 64 | + foreach ($this->checksums as $checksum) { |
|
| 65 | + $writer->writeElement('{' . self::NS_OWNCLOUD . '}checksum', $checksum); |
|
| 66 | + } |
|
| 67 | + } |
|
| 68 | 68 | } |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | return null; |
| 72 | 72 | } |
| 73 | 73 | foreach ($tree as $elem) { |
| 74 | - if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}share-type') { |
|
| 75 | - $shareTypes[] = (int)$elem['value']; |
|
| 74 | + if ($elem['name'] === '{'.self::NS_OWNCLOUD.'}share-type') { |
|
| 75 | + $shareTypes[] = (int) $elem['value']; |
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | return new self($shareTypes); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function xmlSerialize(Writer $writer) { |
| 88 | 88 | foreach ($this->shareTypes as $shareType) { |
| 89 | - $writer->writeElement('{' . self::NS_OWNCLOUD . '}share-type', $shareType); |
|
| 89 | + $writer->writeElement('{'.self::NS_OWNCLOUD.'}share-type', $shareType); |
|
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | } |
@@ -17,58 +17,58 @@ |
||
| 17 | 17 | * This property contains multiple "share-type" elements, each containing a share type. |
| 18 | 18 | */ |
| 19 | 19 | class ShareTypeList implements Element { |
| 20 | - public const NS_OWNCLOUD = 'http://owncloud.org/ns'; |
|
| 20 | + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * @param int[] $shareTypes |
|
| 24 | - */ |
|
| 25 | - public function __construct( |
|
| 26 | - /** |
|
| 27 | - * Share types |
|
| 28 | - */ |
|
| 29 | - private $shareTypes, |
|
| 30 | - ) { |
|
| 31 | - } |
|
| 22 | + /** |
|
| 23 | + * @param int[] $shareTypes |
|
| 24 | + */ |
|
| 25 | + public function __construct( |
|
| 26 | + /** |
|
| 27 | + * Share types |
|
| 28 | + */ |
|
| 29 | + private $shareTypes, |
|
| 30 | + ) { |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Returns the share types |
|
| 35 | - * |
|
| 36 | - * @return int[] |
|
| 37 | - */ |
|
| 38 | - public function getShareTypes() { |
|
| 39 | - return $this->shareTypes; |
|
| 40 | - } |
|
| 33 | + /** |
|
| 34 | + * Returns the share types |
|
| 35 | + * |
|
| 36 | + * @return int[] |
|
| 37 | + */ |
|
| 38 | + public function getShareTypes() { |
|
| 39 | + return $this->shareTypes; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * The deserialize method is called during xml parsing. |
|
| 44 | - * |
|
| 45 | - * @param Reader $reader |
|
| 46 | - * @return mixed |
|
| 47 | - */ |
|
| 48 | - public static function xmlDeserialize(Reader $reader) { |
|
| 49 | - $shareTypes = []; |
|
| 42 | + /** |
|
| 43 | + * The deserialize method is called during xml parsing. |
|
| 44 | + * |
|
| 45 | + * @param Reader $reader |
|
| 46 | + * @return mixed |
|
| 47 | + */ |
|
| 48 | + public static function xmlDeserialize(Reader $reader) { |
|
| 49 | + $shareTypes = []; |
|
| 50 | 50 | |
| 51 | - $tree = $reader->parseInnerTree(); |
|
| 52 | - if ($tree === null) { |
|
| 53 | - return null; |
|
| 54 | - } |
|
| 55 | - foreach ($tree as $elem) { |
|
| 56 | - if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}share-type') { |
|
| 57 | - $shareTypes[] = (int)$elem['value']; |
|
| 58 | - } |
|
| 59 | - } |
|
| 60 | - return new self($shareTypes); |
|
| 61 | - } |
|
| 51 | + $tree = $reader->parseInnerTree(); |
|
| 52 | + if ($tree === null) { |
|
| 53 | + return null; |
|
| 54 | + } |
|
| 55 | + foreach ($tree as $elem) { |
|
| 56 | + if ($elem['name'] === '{' . self::NS_OWNCLOUD . '}share-type') { |
|
| 57 | + $shareTypes[] = (int)$elem['value']; |
|
| 58 | + } |
|
| 59 | + } |
|
| 60 | + return new self($shareTypes); |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - /** |
|
| 64 | - * The xmlSerialize method is called during xml writing. |
|
| 65 | - * |
|
| 66 | - * @param Writer $writer |
|
| 67 | - * @return void |
|
| 68 | - */ |
|
| 69 | - public function xmlSerialize(Writer $writer) { |
|
| 70 | - foreach ($this->shareTypes as $shareType) { |
|
| 71 | - $writer->writeElement('{' . self::NS_OWNCLOUD . '}share-type', $shareType); |
|
| 72 | - } |
|
| 73 | - } |
|
| 63 | + /** |
|
| 64 | + * The xmlSerialize method is called during xml writing. |
|
| 65 | + * |
|
| 66 | + * @param Writer $writer |
|
| 67 | + * @return void |
|
| 68 | + */ |
|
| 69 | + public function xmlSerialize(Writer $writer) { |
|
| 70 | + foreach ($this->shareTypes as $shareType) { |
|
| 71 | + $writer->writeElement('{' . self::NS_OWNCLOUD . '}share-type', $shareType); |
|
| 72 | + } |
|
| 73 | + } |
|
| 74 | 74 | } |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - throw new NotFound('Node with name \'' . $name . '\' could not be found'); |
|
| 111 | + throw new NotFound('Node with name \''.$name.'\' could not be found'); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -29,177 +29,177 @@ |
||
| 29 | 29 | |
| 30 | 30 | class CalendarHome extends \Sabre\CalDAV\CalendarHome { |
| 31 | 31 | |
| 32 | - /** @var IL10N */ |
|
| 33 | - private $l10n; |
|
| 34 | - |
|
| 35 | - /** @var IConfig */ |
|
| 36 | - private $config; |
|
| 37 | - |
|
| 38 | - /** @var PluginManager */ |
|
| 39 | - private $pluginManager; |
|
| 40 | - private ?array $cachedChildren = null; |
|
| 41 | - |
|
| 42 | - public function __construct( |
|
| 43 | - BackendInterface $caldavBackend, |
|
| 44 | - array $principalInfo, |
|
| 45 | - private LoggerInterface $logger, |
|
| 46 | - private bool $returnCachedSubscriptions, |
|
| 47 | - ) { |
|
| 48 | - parent::__construct($caldavBackend, $principalInfo); |
|
| 49 | - $this->l10n = \OC::$server->getL10N('dav'); |
|
| 50 | - $this->config = Server::get(IConfig::class); |
|
| 51 | - $this->pluginManager = new PluginManager( |
|
| 52 | - \OC::$server, |
|
| 53 | - Server::get(IAppManager::class) |
|
| 54 | - ); |
|
| 55 | - } |
|
| 56 | - |
|
| 57 | - /** |
|
| 58 | - * @return BackendInterface |
|
| 59 | - */ |
|
| 60 | - public function getCalDAVBackend() { |
|
| 61 | - return $this->caldavBackend; |
|
| 62 | - } |
|
| 63 | - |
|
| 64 | - /** |
|
| 65 | - * @inheritdoc |
|
| 66 | - */ |
|
| 67 | - public function createExtendedCollection($name, MkCol $mkCol): void { |
|
| 68 | - $reservedNames = [ |
|
| 69 | - BirthdayService::BIRTHDAY_CALENDAR_URI, |
|
| 70 | - TrashbinHome::NAME, |
|
| 71 | - ]; |
|
| 72 | - |
|
| 73 | - if (\in_array($name, $reservedNames, true) || ExternalCalendar::doesViolateReservedName($name)) { |
|
| 74 | - throw new MethodNotAllowed('The resource you tried to create has a reserved name'); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - parent::createExtendedCollection($name, $mkCol); |
|
| 78 | - } |
|
| 79 | - |
|
| 80 | - /** |
|
| 81 | - * @inheritdoc |
|
| 82 | - */ |
|
| 83 | - public function getChildren() { |
|
| 84 | - if ($this->cachedChildren) { |
|
| 85 | - return $this->cachedChildren; |
|
| 86 | - } |
|
| 87 | - $calendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']); |
|
| 88 | - $objects = []; |
|
| 89 | - foreach ($calendars as $calendar) { |
|
| 90 | - $objects[] = new Calendar($this->caldavBackend, $calendar, $this->l10n, $this->config, $this->logger); |
|
| 91 | - } |
|
| 92 | - |
|
| 93 | - if ($this->caldavBackend instanceof SchedulingSupport) { |
|
| 94 | - $objects[] = new Inbox($this->caldavBackend, $this->principalInfo['uri']); |
|
| 95 | - $objects[] = new Outbox($this->config, $this->principalInfo['uri']); |
|
| 96 | - } |
|
| 97 | - |
|
| 98 | - // We're adding a notifications node, if it's supported by the backend. |
|
| 99 | - if ($this->caldavBackend instanceof NotificationSupport) { |
|
| 100 | - $objects[] = new \Sabre\CalDAV\Notifications\Collection($this->caldavBackend, $this->principalInfo['uri']); |
|
| 101 | - } |
|
| 102 | - |
|
| 103 | - if ($this->caldavBackend instanceof CalDavBackend) { |
|
| 104 | - $objects[] = new TrashbinHome($this->caldavBackend, $this->principalInfo); |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - // If the backend supports subscriptions, we'll add those as well, |
|
| 108 | - if ($this->caldavBackend instanceof SubscriptionSupport) { |
|
| 109 | - foreach ($this->caldavBackend->getSubscriptionsForUser($this->principalInfo['uri']) as $subscription) { |
|
| 110 | - if ($this->returnCachedSubscriptions) { |
|
| 111 | - $objects[] = new CachedSubscription($this->caldavBackend, $subscription); |
|
| 112 | - } else { |
|
| 113 | - $objects[] = new Subscription($this->caldavBackend, $subscription); |
|
| 114 | - } |
|
| 115 | - } |
|
| 116 | - } |
|
| 117 | - |
|
| 118 | - foreach ($this->pluginManager->getCalendarPlugins() as $calendarPlugin) { |
|
| 119 | - /** @var ICalendarProvider $calendarPlugin */ |
|
| 120 | - $calendars = $calendarPlugin->fetchAllForCalendarHome($this->principalInfo['uri']); |
|
| 121 | - foreach ($calendars as $calendar) { |
|
| 122 | - $objects[] = $calendar; |
|
| 123 | - } |
|
| 124 | - } |
|
| 125 | - |
|
| 126 | - $this->cachedChildren = $objects; |
|
| 127 | - return $objects; |
|
| 128 | - } |
|
| 129 | - |
|
| 130 | - /** |
|
| 131 | - * @param string $name |
|
| 132 | - * |
|
| 133 | - * @return INode |
|
| 134 | - */ |
|
| 135 | - public function getChild($name) { |
|
| 136 | - // Special nodes |
|
| 137 | - if ($name === 'inbox' && $this->caldavBackend instanceof SchedulingSupport) { |
|
| 138 | - return new Inbox($this->caldavBackend, $this->principalInfo['uri']); |
|
| 139 | - } |
|
| 140 | - if ($name === 'outbox' && $this->caldavBackend instanceof SchedulingSupport) { |
|
| 141 | - return new Outbox($this->config, $this->principalInfo['uri']); |
|
| 142 | - } |
|
| 143 | - if ($name === 'notifications' && $this->caldavBackend instanceof NotificationSupport) { |
|
| 144 | - return new \Sabre\CalDAV\Notifications\Collection($this->caldavBackend, $this->principalInfo['uri']); |
|
| 145 | - } |
|
| 146 | - if ($name === TrashbinHome::NAME && $this->caldavBackend instanceof CalDavBackend) { |
|
| 147 | - return new TrashbinHome($this->caldavBackend, $this->principalInfo); |
|
| 148 | - } |
|
| 149 | - |
|
| 150 | - // Calendar - this covers all "regular" calendars, but not shared |
|
| 151 | - // only check if the method is available |
|
| 152 | - if ($this->caldavBackend instanceof CalDavBackend) { |
|
| 153 | - $calendar = $this->caldavBackend->getCalendarByUri($this->principalInfo['uri'], $name); |
|
| 154 | - if (!empty($calendar)) { |
|
| 155 | - return new Calendar($this->caldavBackend, $calendar, $this->l10n, $this->config, $this->logger); |
|
| 156 | - } |
|
| 157 | - } |
|
| 158 | - |
|
| 159 | - // Fallback to cover shared calendars |
|
| 160 | - foreach ($this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']) as $calendar) { |
|
| 161 | - if ($calendar['uri'] === $name) { |
|
| 162 | - return new Calendar($this->caldavBackend, $calendar, $this->l10n, $this->config, $this->logger); |
|
| 163 | - } |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - if ($this->caldavBackend instanceof SubscriptionSupport) { |
|
| 167 | - foreach ($this->caldavBackend->getSubscriptionsForUser($this->principalInfo['uri']) as $subscription) { |
|
| 168 | - if ($subscription['uri'] === $name) { |
|
| 169 | - if ($this->returnCachedSubscriptions) { |
|
| 170 | - return new CachedSubscription($this->caldavBackend, $subscription); |
|
| 171 | - } |
|
| 172 | - |
|
| 173 | - return new Subscription($this->caldavBackend, $subscription); |
|
| 174 | - } |
|
| 175 | - } |
|
| 176 | - } |
|
| 177 | - |
|
| 178 | - if (ExternalCalendar::isAppGeneratedCalendar($name)) { |
|
| 179 | - [$appId, $calendarUri] = ExternalCalendar::splitAppGeneratedCalendarUri($name); |
|
| 180 | - |
|
| 181 | - foreach ($this->pluginManager->getCalendarPlugins() as $calendarPlugin) { |
|
| 182 | - /** @var ICalendarProvider $calendarPlugin */ |
|
| 183 | - if ($calendarPlugin->getAppId() !== $appId) { |
|
| 184 | - continue; |
|
| 185 | - } |
|
| 186 | - |
|
| 187 | - if ($calendarPlugin->hasCalendarInCalendarHome($this->principalInfo['uri'], $calendarUri)) { |
|
| 188 | - return $calendarPlugin->getCalendarInCalendarHome($this->principalInfo['uri'], $calendarUri); |
|
| 189 | - } |
|
| 190 | - } |
|
| 191 | - } |
|
| 192 | - |
|
| 193 | - throw new NotFound('Node with name \'' . $name . '\' could not be found'); |
|
| 194 | - } |
|
| 195 | - |
|
| 196 | - /** |
|
| 197 | - * @param array $filters |
|
| 198 | - * @param integer|null $limit |
|
| 199 | - * @param integer|null $offset |
|
| 200 | - */ |
|
| 201 | - public function calendarSearch(array $filters, $limit = null, $offset = null) { |
|
| 202 | - $principalUri = $this->principalInfo['uri']; |
|
| 203 | - return $this->caldavBackend->calendarSearch($principalUri, $filters, $limit, $offset); |
|
| 204 | - } |
|
| 32 | + /** @var IL10N */ |
|
| 33 | + private $l10n; |
|
| 34 | + |
|
| 35 | + /** @var IConfig */ |
|
| 36 | + private $config; |
|
| 37 | + |
|
| 38 | + /** @var PluginManager */ |
|
| 39 | + private $pluginManager; |
|
| 40 | + private ?array $cachedChildren = null; |
|
| 41 | + |
|
| 42 | + public function __construct( |
|
| 43 | + BackendInterface $caldavBackend, |
|
| 44 | + array $principalInfo, |
|
| 45 | + private LoggerInterface $logger, |
|
| 46 | + private bool $returnCachedSubscriptions, |
|
| 47 | + ) { |
|
| 48 | + parent::__construct($caldavBackend, $principalInfo); |
|
| 49 | + $this->l10n = \OC::$server->getL10N('dav'); |
|
| 50 | + $this->config = Server::get(IConfig::class); |
|
| 51 | + $this->pluginManager = new PluginManager( |
|
| 52 | + \OC::$server, |
|
| 53 | + Server::get(IAppManager::class) |
|
| 54 | + ); |
|
| 55 | + } |
|
| 56 | + |
|
| 57 | + /** |
|
| 58 | + * @return BackendInterface |
|
| 59 | + */ |
|
| 60 | + public function getCalDAVBackend() { |
|
| 61 | + return $this->caldavBackend; |
|
| 62 | + } |
|
| 63 | + |
|
| 64 | + /** |
|
| 65 | + * @inheritdoc |
|
| 66 | + */ |
|
| 67 | + public function createExtendedCollection($name, MkCol $mkCol): void { |
|
| 68 | + $reservedNames = [ |
|
| 69 | + BirthdayService::BIRTHDAY_CALENDAR_URI, |
|
| 70 | + TrashbinHome::NAME, |
|
| 71 | + ]; |
|
| 72 | + |
|
| 73 | + if (\in_array($name, $reservedNames, true) || ExternalCalendar::doesViolateReservedName($name)) { |
|
| 74 | + throw new MethodNotAllowed('The resource you tried to create has a reserved name'); |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + parent::createExtendedCollection($name, $mkCol); |
|
| 78 | + } |
|
| 79 | + |
|
| 80 | + /** |
|
| 81 | + * @inheritdoc |
|
| 82 | + */ |
|
| 83 | + public function getChildren() { |
|
| 84 | + if ($this->cachedChildren) { |
|
| 85 | + return $this->cachedChildren; |
|
| 86 | + } |
|
| 87 | + $calendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']); |
|
| 88 | + $objects = []; |
|
| 89 | + foreach ($calendars as $calendar) { |
|
| 90 | + $objects[] = new Calendar($this->caldavBackend, $calendar, $this->l10n, $this->config, $this->logger); |
|
| 91 | + } |
|
| 92 | + |
|
| 93 | + if ($this->caldavBackend instanceof SchedulingSupport) { |
|
| 94 | + $objects[] = new Inbox($this->caldavBackend, $this->principalInfo['uri']); |
|
| 95 | + $objects[] = new Outbox($this->config, $this->principalInfo['uri']); |
|
| 96 | + } |
|
| 97 | + |
|
| 98 | + // We're adding a notifications node, if it's supported by the backend. |
|
| 99 | + if ($this->caldavBackend instanceof NotificationSupport) { |
|
| 100 | + $objects[] = new \Sabre\CalDAV\Notifications\Collection($this->caldavBackend, $this->principalInfo['uri']); |
|
| 101 | + } |
|
| 102 | + |
|
| 103 | + if ($this->caldavBackend instanceof CalDavBackend) { |
|
| 104 | + $objects[] = new TrashbinHome($this->caldavBackend, $this->principalInfo); |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + // If the backend supports subscriptions, we'll add those as well, |
|
| 108 | + if ($this->caldavBackend instanceof SubscriptionSupport) { |
|
| 109 | + foreach ($this->caldavBackend->getSubscriptionsForUser($this->principalInfo['uri']) as $subscription) { |
|
| 110 | + if ($this->returnCachedSubscriptions) { |
|
| 111 | + $objects[] = new CachedSubscription($this->caldavBackend, $subscription); |
|
| 112 | + } else { |
|
| 113 | + $objects[] = new Subscription($this->caldavBackend, $subscription); |
|
| 114 | + } |
|
| 115 | + } |
|
| 116 | + } |
|
| 117 | + |
|
| 118 | + foreach ($this->pluginManager->getCalendarPlugins() as $calendarPlugin) { |
|
| 119 | + /** @var ICalendarProvider $calendarPlugin */ |
|
| 120 | + $calendars = $calendarPlugin->fetchAllForCalendarHome($this->principalInfo['uri']); |
|
| 121 | + foreach ($calendars as $calendar) { |
|
| 122 | + $objects[] = $calendar; |
|
| 123 | + } |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + $this->cachedChildren = $objects; |
|
| 127 | + return $objects; |
|
| 128 | + } |
|
| 129 | + |
|
| 130 | + /** |
|
| 131 | + * @param string $name |
|
| 132 | + * |
|
| 133 | + * @return INode |
|
| 134 | + */ |
|
| 135 | + public function getChild($name) { |
|
| 136 | + // Special nodes |
|
| 137 | + if ($name === 'inbox' && $this->caldavBackend instanceof SchedulingSupport) { |
|
| 138 | + return new Inbox($this->caldavBackend, $this->principalInfo['uri']); |
|
| 139 | + } |
|
| 140 | + if ($name === 'outbox' && $this->caldavBackend instanceof SchedulingSupport) { |
|
| 141 | + return new Outbox($this->config, $this->principalInfo['uri']); |
|
| 142 | + } |
|
| 143 | + if ($name === 'notifications' && $this->caldavBackend instanceof NotificationSupport) { |
|
| 144 | + return new \Sabre\CalDAV\Notifications\Collection($this->caldavBackend, $this->principalInfo['uri']); |
|
| 145 | + } |
|
| 146 | + if ($name === TrashbinHome::NAME && $this->caldavBackend instanceof CalDavBackend) { |
|
| 147 | + return new TrashbinHome($this->caldavBackend, $this->principalInfo); |
|
| 148 | + } |
|
| 149 | + |
|
| 150 | + // Calendar - this covers all "regular" calendars, but not shared |
|
| 151 | + // only check if the method is available |
|
| 152 | + if ($this->caldavBackend instanceof CalDavBackend) { |
|
| 153 | + $calendar = $this->caldavBackend->getCalendarByUri($this->principalInfo['uri'], $name); |
|
| 154 | + if (!empty($calendar)) { |
|
| 155 | + return new Calendar($this->caldavBackend, $calendar, $this->l10n, $this->config, $this->logger); |
|
| 156 | + } |
|
| 157 | + } |
|
| 158 | + |
|
| 159 | + // Fallback to cover shared calendars |
|
| 160 | + foreach ($this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']) as $calendar) { |
|
| 161 | + if ($calendar['uri'] === $name) { |
|
| 162 | + return new Calendar($this->caldavBackend, $calendar, $this->l10n, $this->config, $this->logger); |
|
| 163 | + } |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + if ($this->caldavBackend instanceof SubscriptionSupport) { |
|
| 167 | + foreach ($this->caldavBackend->getSubscriptionsForUser($this->principalInfo['uri']) as $subscription) { |
|
| 168 | + if ($subscription['uri'] === $name) { |
|
| 169 | + if ($this->returnCachedSubscriptions) { |
|
| 170 | + return new CachedSubscription($this->caldavBackend, $subscription); |
|
| 171 | + } |
|
| 172 | + |
|
| 173 | + return new Subscription($this->caldavBackend, $subscription); |
|
| 174 | + } |
|
| 175 | + } |
|
| 176 | + } |
|
| 177 | + |
|
| 178 | + if (ExternalCalendar::isAppGeneratedCalendar($name)) { |
|
| 179 | + [$appId, $calendarUri] = ExternalCalendar::splitAppGeneratedCalendarUri($name); |
|
| 180 | + |
|
| 181 | + foreach ($this->pluginManager->getCalendarPlugins() as $calendarPlugin) { |
|
| 182 | + /** @var ICalendarProvider $calendarPlugin */ |
|
| 183 | + if ($calendarPlugin->getAppId() !== $appId) { |
|
| 184 | + continue; |
|
| 185 | + } |
|
| 186 | + |
|
| 187 | + if ($calendarPlugin->hasCalendarInCalendarHome($this->principalInfo['uri'], $calendarUri)) { |
|
| 188 | + return $calendarPlugin->getCalendarInCalendarHome($this->principalInfo['uri'], $calendarUri); |
|
| 189 | + } |
|
| 190 | + } |
|
| 191 | + } |
|
| 192 | + |
|
| 193 | + throw new NotFound('Node with name \'' . $name . '\' could not be found'); |
|
| 194 | + } |
|
| 195 | + |
|
| 196 | + /** |
|
| 197 | + * @param array $filters |
|
| 198 | + * @param integer|null $limit |
|
| 199 | + * @param integer|null $offset |
|
| 200 | + */ |
|
| 201 | + public function calendarSearch(array $filters, $limit = null, $offset = null) { |
|
| 202 | + $principalUri = $this->principalInfo['uri']; |
|
| 203 | + return $this->caldavBackend->calendarSearch($principalUri, $filters, $limit, $offset); |
|
| 204 | + } |
|
| 205 | 205 | } |
@@ -23,11 +23,11 @@ |
||
| 23 | 23 | |
| 24 | 24 | class PublicCalendarObject extends CalendarObject { |
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * public calendars are always shared |
|
| 28 | - * @return bool |
|
| 29 | - */ |
|
| 30 | - protected function isShared() { |
|
| 31 | - return true; |
|
| 32 | - } |
|
| 26 | + /** |
|
| 27 | + * public calendars are always shared |
|
| 28 | + * @return bool |
|
| 29 | + */ |
|
| 30 | + protected function isShared() { |
|
| 31 | + return true; |
|
| 32 | + } |
|
| 33 | 33 | } |