@@ -147,7 +147,7 @@ |
||
| 147 | 147 | if (isset($this->entityTypeCollections[$name])) { |
| 148 | 148 | return $this->entityTypeCollections[$name]; |
| 149 | 149 | } |
| 150 | - throw new NotFound('Entity type "' . $name . '" not found."'); |
|
| 150 | + throw new NotFound('Entity type "'.$name.'" not found."'); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
@@ -37,168 +37,168 @@ |
||
| 37 | 37 | |
| 38 | 38 | class RootCollection implements ICollection { |
| 39 | 39 | |
| 40 | - /** @var EntityTypeCollection[]|null */ |
|
| 41 | - private $entityTypeCollections; |
|
| 42 | - |
|
| 43 | - /** @var ICommentsManager */ |
|
| 44 | - protected $commentsManager; |
|
| 45 | - |
|
| 46 | - /** @var string */ |
|
| 47 | - protected $name = 'comments'; |
|
| 48 | - |
|
| 49 | - protected LoggerInterface $logger; |
|
| 50 | - |
|
| 51 | - /** @var IUserManager */ |
|
| 52 | - protected $userManager; |
|
| 53 | - |
|
| 54 | - /** @var IUserSession */ |
|
| 55 | - protected $userSession; |
|
| 56 | - |
|
| 57 | - /** @var EventDispatcherInterface */ |
|
| 58 | - protected $dispatcher; |
|
| 59 | - |
|
| 60 | - public function __construct( |
|
| 61 | - ICommentsManager $commentsManager, |
|
| 62 | - IUserManager $userManager, |
|
| 63 | - IUserSession $userSession, |
|
| 64 | - EventDispatcherInterface $dispatcher, |
|
| 65 | - LoggerInterface $logger) { |
|
| 66 | - $this->commentsManager = $commentsManager; |
|
| 67 | - $this->logger = $logger; |
|
| 68 | - $this->userManager = $userManager; |
|
| 69 | - $this->userSession = $userSession; |
|
| 70 | - $this->dispatcher = $dispatcher; |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - /** |
|
| 74 | - * initializes the collection. At this point of time, we need the logged in |
|
| 75 | - * user. Since it is not the case when the instance is created, we cannot |
|
| 76 | - * have this in the constructor. |
|
| 77 | - * |
|
| 78 | - * @throws NotAuthenticated |
|
| 79 | - */ |
|
| 80 | - protected function initCollections() { |
|
| 81 | - if ($this->entityTypeCollections !== null) { |
|
| 82 | - return; |
|
| 83 | - } |
|
| 84 | - $user = $this->userSession->getUser(); |
|
| 85 | - if (is_null($user)) { |
|
| 86 | - throw new NotAuthenticated(); |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - $event = new CommentsEntityEvent(CommentsEntityEvent::EVENT_ENTITY); |
|
| 90 | - $this->dispatcher->dispatch(CommentsEntityEvent::EVENT_ENTITY, $event); |
|
| 91 | - |
|
| 92 | - $this->entityTypeCollections = []; |
|
| 93 | - foreach ($event->getEntityCollections() as $entity => $entityExistsFunction) { |
|
| 94 | - $this->entityTypeCollections[$entity] = new EntityTypeCollection( |
|
| 95 | - $entity, |
|
| 96 | - $this->commentsManager, |
|
| 97 | - $this->userManager, |
|
| 98 | - $this->userSession, |
|
| 99 | - $this->logger, |
|
| 100 | - $entityExistsFunction |
|
| 101 | - ); |
|
| 102 | - } |
|
| 103 | - } |
|
| 104 | - |
|
| 105 | - /** |
|
| 106 | - * Creates a new file in the directory |
|
| 107 | - * |
|
| 108 | - * @param string $name Name of the file |
|
| 109 | - * @param resource|string $data Initial payload |
|
| 110 | - * @return null|string |
|
| 111 | - * @throws Forbidden |
|
| 112 | - */ |
|
| 113 | - public function createFile($name, $data = null) { |
|
| 114 | - throw new Forbidden('Cannot create comments by id'); |
|
| 115 | - } |
|
| 116 | - |
|
| 117 | - /** |
|
| 118 | - * Creates a new subdirectory |
|
| 119 | - * |
|
| 120 | - * @param string $name |
|
| 121 | - * @throws Forbidden |
|
| 122 | - */ |
|
| 123 | - public function createDirectory($name) { |
|
| 124 | - throw new Forbidden('Permission denied to create collections'); |
|
| 125 | - } |
|
| 126 | - |
|
| 127 | - /** |
|
| 128 | - * Returns a specific child node, referenced by its name |
|
| 129 | - * |
|
| 130 | - * This method must throw Sabre\DAV\Exception\NotFound if the node does not |
|
| 131 | - * exist. |
|
| 132 | - * |
|
| 133 | - * @param string $name |
|
| 134 | - * @return \Sabre\DAV\INode |
|
| 135 | - * @throws NotFound |
|
| 136 | - */ |
|
| 137 | - public function getChild($name) { |
|
| 138 | - $this->initCollections(); |
|
| 139 | - if (isset($this->entityTypeCollections[$name])) { |
|
| 140 | - return $this->entityTypeCollections[$name]; |
|
| 141 | - } |
|
| 142 | - throw new NotFound('Entity type "' . $name . '" not found."'); |
|
| 143 | - } |
|
| 144 | - |
|
| 145 | - /** |
|
| 146 | - * Returns an array with all the child nodes |
|
| 147 | - * |
|
| 148 | - * @return \Sabre\DAV\INode[] |
|
| 149 | - */ |
|
| 150 | - public function getChildren() { |
|
| 151 | - $this->initCollections(); |
|
| 152 | - return $this->entityTypeCollections; |
|
| 153 | - } |
|
| 154 | - |
|
| 155 | - /** |
|
| 156 | - * Checks if a child-node with the specified name exists |
|
| 157 | - * |
|
| 158 | - * @param string $name |
|
| 159 | - * @return bool |
|
| 160 | - */ |
|
| 161 | - public function childExists($name) { |
|
| 162 | - $this->initCollections(); |
|
| 163 | - return isset($this->entityTypeCollections[$name]); |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - /** |
|
| 167 | - * Deleted the current node |
|
| 168 | - * |
|
| 169 | - * @throws Forbidden |
|
| 170 | - */ |
|
| 171 | - public function delete() { |
|
| 172 | - throw new Forbidden('Permission denied to delete this collection'); |
|
| 173 | - } |
|
| 174 | - |
|
| 175 | - /** |
|
| 176 | - * Returns the name of the node. |
|
| 177 | - * |
|
| 178 | - * This is used to generate the url. |
|
| 179 | - * |
|
| 180 | - * @return string |
|
| 181 | - */ |
|
| 182 | - public function getName() { |
|
| 183 | - return $this->name; |
|
| 184 | - } |
|
| 185 | - |
|
| 186 | - /** |
|
| 187 | - * Renames the node |
|
| 188 | - * |
|
| 189 | - * @param string $name The new name |
|
| 190 | - * @throws Forbidden |
|
| 191 | - */ |
|
| 192 | - public function setName($name) { |
|
| 193 | - throw new Forbidden('Permission denied to rename this collection'); |
|
| 194 | - } |
|
| 195 | - |
|
| 196 | - /** |
|
| 197 | - * Returns the last modification time, as a unix timestamp |
|
| 198 | - * |
|
| 199 | - * @return int |
|
| 200 | - */ |
|
| 201 | - public function getLastModified() { |
|
| 202 | - return null; |
|
| 203 | - } |
|
| 40 | + /** @var EntityTypeCollection[]|null */ |
|
| 41 | + private $entityTypeCollections; |
|
| 42 | + |
|
| 43 | + /** @var ICommentsManager */ |
|
| 44 | + protected $commentsManager; |
|
| 45 | + |
|
| 46 | + /** @var string */ |
|
| 47 | + protected $name = 'comments'; |
|
| 48 | + |
|
| 49 | + protected LoggerInterface $logger; |
|
| 50 | + |
|
| 51 | + /** @var IUserManager */ |
|
| 52 | + protected $userManager; |
|
| 53 | + |
|
| 54 | + /** @var IUserSession */ |
|
| 55 | + protected $userSession; |
|
| 56 | + |
|
| 57 | + /** @var EventDispatcherInterface */ |
|
| 58 | + protected $dispatcher; |
|
| 59 | + |
|
| 60 | + public function __construct( |
|
| 61 | + ICommentsManager $commentsManager, |
|
| 62 | + IUserManager $userManager, |
|
| 63 | + IUserSession $userSession, |
|
| 64 | + EventDispatcherInterface $dispatcher, |
|
| 65 | + LoggerInterface $logger) { |
|
| 66 | + $this->commentsManager = $commentsManager; |
|
| 67 | + $this->logger = $logger; |
|
| 68 | + $this->userManager = $userManager; |
|
| 69 | + $this->userSession = $userSession; |
|
| 70 | + $this->dispatcher = $dispatcher; |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + /** |
|
| 74 | + * initializes the collection. At this point of time, we need the logged in |
|
| 75 | + * user. Since it is not the case when the instance is created, we cannot |
|
| 76 | + * have this in the constructor. |
|
| 77 | + * |
|
| 78 | + * @throws NotAuthenticated |
|
| 79 | + */ |
|
| 80 | + protected function initCollections() { |
|
| 81 | + if ($this->entityTypeCollections !== null) { |
|
| 82 | + return; |
|
| 83 | + } |
|
| 84 | + $user = $this->userSession->getUser(); |
|
| 85 | + if (is_null($user)) { |
|
| 86 | + throw new NotAuthenticated(); |
|
| 87 | + } |
|
| 88 | + |
|
| 89 | + $event = new CommentsEntityEvent(CommentsEntityEvent::EVENT_ENTITY); |
|
| 90 | + $this->dispatcher->dispatch(CommentsEntityEvent::EVENT_ENTITY, $event); |
|
| 91 | + |
|
| 92 | + $this->entityTypeCollections = []; |
|
| 93 | + foreach ($event->getEntityCollections() as $entity => $entityExistsFunction) { |
|
| 94 | + $this->entityTypeCollections[$entity] = new EntityTypeCollection( |
|
| 95 | + $entity, |
|
| 96 | + $this->commentsManager, |
|
| 97 | + $this->userManager, |
|
| 98 | + $this->userSession, |
|
| 99 | + $this->logger, |
|
| 100 | + $entityExistsFunction |
|
| 101 | + ); |
|
| 102 | + } |
|
| 103 | + } |
|
| 104 | + |
|
| 105 | + /** |
|
| 106 | + * Creates a new file in the directory |
|
| 107 | + * |
|
| 108 | + * @param string $name Name of the file |
|
| 109 | + * @param resource|string $data Initial payload |
|
| 110 | + * @return null|string |
|
| 111 | + * @throws Forbidden |
|
| 112 | + */ |
|
| 113 | + public function createFile($name, $data = null) { |
|
| 114 | + throw new Forbidden('Cannot create comments by id'); |
|
| 115 | + } |
|
| 116 | + |
|
| 117 | + /** |
|
| 118 | + * Creates a new subdirectory |
|
| 119 | + * |
|
| 120 | + * @param string $name |
|
| 121 | + * @throws Forbidden |
|
| 122 | + */ |
|
| 123 | + public function createDirectory($name) { |
|
| 124 | + throw new Forbidden('Permission denied to create collections'); |
|
| 125 | + } |
|
| 126 | + |
|
| 127 | + /** |
|
| 128 | + * Returns a specific child node, referenced by its name |
|
| 129 | + * |
|
| 130 | + * This method must throw Sabre\DAV\Exception\NotFound if the node does not |
|
| 131 | + * exist. |
|
| 132 | + * |
|
| 133 | + * @param string $name |
|
| 134 | + * @return \Sabre\DAV\INode |
|
| 135 | + * @throws NotFound |
|
| 136 | + */ |
|
| 137 | + public function getChild($name) { |
|
| 138 | + $this->initCollections(); |
|
| 139 | + if (isset($this->entityTypeCollections[$name])) { |
|
| 140 | + return $this->entityTypeCollections[$name]; |
|
| 141 | + } |
|
| 142 | + throw new NotFound('Entity type "' . $name . '" not found."'); |
|
| 143 | + } |
|
| 144 | + |
|
| 145 | + /** |
|
| 146 | + * Returns an array with all the child nodes |
|
| 147 | + * |
|
| 148 | + * @return \Sabre\DAV\INode[] |
|
| 149 | + */ |
|
| 150 | + public function getChildren() { |
|
| 151 | + $this->initCollections(); |
|
| 152 | + return $this->entityTypeCollections; |
|
| 153 | + } |
|
| 154 | + |
|
| 155 | + /** |
|
| 156 | + * Checks if a child-node with the specified name exists |
|
| 157 | + * |
|
| 158 | + * @param string $name |
|
| 159 | + * @return bool |
|
| 160 | + */ |
|
| 161 | + public function childExists($name) { |
|
| 162 | + $this->initCollections(); |
|
| 163 | + return isset($this->entityTypeCollections[$name]); |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + /** |
|
| 167 | + * Deleted the current node |
|
| 168 | + * |
|
| 169 | + * @throws Forbidden |
|
| 170 | + */ |
|
| 171 | + public function delete() { |
|
| 172 | + throw new Forbidden('Permission denied to delete this collection'); |
|
| 173 | + } |
|
| 174 | + |
|
| 175 | + /** |
|
| 176 | + * Returns the name of the node. |
|
| 177 | + * |
|
| 178 | + * This is used to generate the url. |
|
| 179 | + * |
|
| 180 | + * @return string |
|
| 181 | + */ |
|
| 182 | + public function getName() { |
|
| 183 | + return $this->name; |
|
| 184 | + } |
|
| 185 | + |
|
| 186 | + /** |
|
| 187 | + * Renames the node |
|
| 188 | + * |
|
| 189 | + * @param string $name The new name |
|
| 190 | + * @throws Forbidden |
|
| 191 | + */ |
|
| 192 | + public function setName($name) { |
|
| 193 | + throw new Forbidden('Permission denied to rename this collection'); |
|
| 194 | + } |
|
| 195 | + |
|
| 196 | + /** |
|
| 197 | + * Returns the last modification time, as a unix timestamp |
|
| 198 | + * |
|
| 199 | + * @return int |
|
| 200 | + */ |
|
| 201 | + public function getLastModified() { |
|
| 202 | + return null; |
|
| 203 | + } |
|
| 204 | 204 | } |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | foreach (['id', 'name'] as $property) { |
| 69 | 69 | $$property = trim($$property); |
| 70 | 70 | if (empty($$property) || !is_string($$property)) { |
| 71 | - throw new \InvalidArgumentException('"' . $property . '" parameter must be non-empty string'); |
|
| 71 | + throw new \InvalidArgumentException('"'.$property.'" parameter must be non-empty string'); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | $this->id = $id; |
@@ -41,154 +41,154 @@ |
||
| 41 | 41 | * @package OCA\DAV\Comments |
| 42 | 42 | */ |
| 43 | 43 | class EntityCollection extends RootCollection implements IProperties { |
| 44 | - public const PROPERTY_NAME_READ_MARKER = '{http://owncloud.org/ns}readMarker'; |
|
| 44 | + public const PROPERTY_NAME_READ_MARKER = '{http://owncloud.org/ns}readMarker'; |
|
| 45 | 45 | |
| 46 | - /** @var string */ |
|
| 47 | - protected $id; |
|
| 46 | + /** @var string */ |
|
| 47 | + protected $id; |
|
| 48 | 48 | |
| 49 | - protected LoggerInterface $logger; |
|
| 49 | + protected LoggerInterface $logger; |
|
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * @param string $id |
|
| 53 | - * @param string $name |
|
| 54 | - * @param ICommentsManager $commentsManager |
|
| 55 | - * @param IUserManager $userManager |
|
| 56 | - * @param IUserSession $userSession |
|
| 57 | - * @param LoggerInterface $logger |
|
| 58 | - */ |
|
| 59 | - public function __construct( |
|
| 60 | - $id, |
|
| 61 | - $name, |
|
| 62 | - ICommentsManager $commentsManager, |
|
| 63 | - IUserManager $userManager, |
|
| 64 | - IUserSession $userSession, |
|
| 65 | - LoggerInterface $logger |
|
| 66 | - ) { |
|
| 67 | - foreach (['id', 'name'] as $property) { |
|
| 68 | - $$property = trim($$property); |
|
| 69 | - if (empty($$property) || !is_string($$property)) { |
|
| 70 | - throw new \InvalidArgumentException('"' . $property . '" parameter must be non-empty string'); |
|
| 71 | - } |
|
| 72 | - } |
|
| 73 | - $this->id = $id; |
|
| 74 | - $this->name = $name; |
|
| 75 | - $this->commentsManager = $commentsManager; |
|
| 76 | - $this->logger = $logger; |
|
| 77 | - $this->userManager = $userManager; |
|
| 78 | - $this->userSession = $userSession; |
|
| 79 | - } |
|
| 51 | + /** |
|
| 52 | + * @param string $id |
|
| 53 | + * @param string $name |
|
| 54 | + * @param ICommentsManager $commentsManager |
|
| 55 | + * @param IUserManager $userManager |
|
| 56 | + * @param IUserSession $userSession |
|
| 57 | + * @param LoggerInterface $logger |
|
| 58 | + */ |
|
| 59 | + public function __construct( |
|
| 60 | + $id, |
|
| 61 | + $name, |
|
| 62 | + ICommentsManager $commentsManager, |
|
| 63 | + IUserManager $userManager, |
|
| 64 | + IUserSession $userSession, |
|
| 65 | + LoggerInterface $logger |
|
| 66 | + ) { |
|
| 67 | + foreach (['id', 'name'] as $property) { |
|
| 68 | + $$property = trim($$property); |
|
| 69 | + if (empty($$property) || !is_string($$property)) { |
|
| 70 | + throw new \InvalidArgumentException('"' . $property . '" parameter must be non-empty string'); |
|
| 71 | + } |
|
| 72 | + } |
|
| 73 | + $this->id = $id; |
|
| 74 | + $this->name = $name; |
|
| 75 | + $this->commentsManager = $commentsManager; |
|
| 76 | + $this->logger = $logger; |
|
| 77 | + $this->userManager = $userManager; |
|
| 78 | + $this->userSession = $userSession; |
|
| 79 | + } |
|
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * returns the ID of this entity |
|
| 83 | - * |
|
| 84 | - * @return string |
|
| 85 | - */ |
|
| 86 | - public function getId() { |
|
| 87 | - return $this->id; |
|
| 88 | - } |
|
| 81 | + /** |
|
| 82 | + * returns the ID of this entity |
|
| 83 | + * |
|
| 84 | + * @return string |
|
| 85 | + */ |
|
| 86 | + public function getId() { |
|
| 87 | + return $this->id; |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | - /** |
|
| 91 | - * Returns a specific child node, referenced by its name |
|
| 92 | - * |
|
| 93 | - * This method must throw Sabre\DAV\Exception\NotFound if the node does not |
|
| 94 | - * exist. |
|
| 95 | - * |
|
| 96 | - * @param string $name |
|
| 97 | - * @return \Sabre\DAV\INode |
|
| 98 | - * @throws NotFound |
|
| 99 | - */ |
|
| 100 | - public function getChild($name) { |
|
| 101 | - try { |
|
| 102 | - $comment = $this->commentsManager->get($name); |
|
| 103 | - return new CommentNode( |
|
| 104 | - $this->commentsManager, |
|
| 105 | - $comment, |
|
| 106 | - $this->userManager, |
|
| 107 | - $this->userSession, |
|
| 108 | - $this->logger |
|
| 109 | - ); |
|
| 110 | - } catch (NotFoundException $e) { |
|
| 111 | - throw new NotFound(); |
|
| 112 | - } |
|
| 113 | - } |
|
| 90 | + /** |
|
| 91 | + * Returns a specific child node, referenced by its name |
|
| 92 | + * |
|
| 93 | + * This method must throw Sabre\DAV\Exception\NotFound if the node does not |
|
| 94 | + * exist. |
|
| 95 | + * |
|
| 96 | + * @param string $name |
|
| 97 | + * @return \Sabre\DAV\INode |
|
| 98 | + * @throws NotFound |
|
| 99 | + */ |
|
| 100 | + public function getChild($name) { |
|
| 101 | + try { |
|
| 102 | + $comment = $this->commentsManager->get($name); |
|
| 103 | + return new CommentNode( |
|
| 104 | + $this->commentsManager, |
|
| 105 | + $comment, |
|
| 106 | + $this->userManager, |
|
| 107 | + $this->userSession, |
|
| 108 | + $this->logger |
|
| 109 | + ); |
|
| 110 | + } catch (NotFoundException $e) { |
|
| 111 | + throw new NotFound(); |
|
| 112 | + } |
|
| 113 | + } |
|
| 114 | 114 | |
| 115 | - /** |
|
| 116 | - * Returns an array with all the child nodes |
|
| 117 | - * |
|
| 118 | - * @return \Sabre\DAV\INode[] |
|
| 119 | - */ |
|
| 120 | - public function getChildren() { |
|
| 121 | - return $this->findChildren(); |
|
| 122 | - } |
|
| 115 | + /** |
|
| 116 | + * Returns an array with all the child nodes |
|
| 117 | + * |
|
| 118 | + * @return \Sabre\DAV\INode[] |
|
| 119 | + */ |
|
| 120 | + public function getChildren() { |
|
| 121 | + return $this->findChildren(); |
|
| 122 | + } |
|
| 123 | 123 | |
| 124 | - /** |
|
| 125 | - * Returns an array of comment nodes. Result can be influenced by offset, |
|
| 126 | - * limit and date time parameters. |
|
| 127 | - * |
|
| 128 | - * @param int $limit |
|
| 129 | - * @param int $offset |
|
| 130 | - * @param \DateTime|null $datetime |
|
| 131 | - * @return CommentNode[] |
|
| 132 | - */ |
|
| 133 | - public function findChildren($limit = 0, $offset = 0, \DateTime $datetime = null) { |
|
| 134 | - $comments = $this->commentsManager->getForObject($this->name, $this->id, $limit, $offset, $datetime); |
|
| 135 | - $result = []; |
|
| 136 | - foreach ($comments as $comment) { |
|
| 137 | - $result[] = new CommentNode( |
|
| 138 | - $this->commentsManager, |
|
| 139 | - $comment, |
|
| 140 | - $this->userManager, |
|
| 141 | - $this->userSession, |
|
| 142 | - $this->logger |
|
| 143 | - ); |
|
| 144 | - } |
|
| 145 | - return $result; |
|
| 146 | - } |
|
| 124 | + /** |
|
| 125 | + * Returns an array of comment nodes. Result can be influenced by offset, |
|
| 126 | + * limit and date time parameters. |
|
| 127 | + * |
|
| 128 | + * @param int $limit |
|
| 129 | + * @param int $offset |
|
| 130 | + * @param \DateTime|null $datetime |
|
| 131 | + * @return CommentNode[] |
|
| 132 | + */ |
|
| 133 | + public function findChildren($limit = 0, $offset = 0, \DateTime $datetime = null) { |
|
| 134 | + $comments = $this->commentsManager->getForObject($this->name, $this->id, $limit, $offset, $datetime); |
|
| 135 | + $result = []; |
|
| 136 | + foreach ($comments as $comment) { |
|
| 137 | + $result[] = new CommentNode( |
|
| 138 | + $this->commentsManager, |
|
| 139 | + $comment, |
|
| 140 | + $this->userManager, |
|
| 141 | + $this->userSession, |
|
| 142 | + $this->logger |
|
| 143 | + ); |
|
| 144 | + } |
|
| 145 | + return $result; |
|
| 146 | + } |
|
| 147 | 147 | |
| 148 | - /** |
|
| 149 | - * Checks if a child-node with the specified name exists |
|
| 150 | - * |
|
| 151 | - * @param string $name |
|
| 152 | - * @return bool |
|
| 153 | - */ |
|
| 154 | - public function childExists($name) { |
|
| 155 | - try { |
|
| 156 | - $this->commentsManager->get($name); |
|
| 157 | - return true; |
|
| 158 | - } catch (NotFoundException $e) { |
|
| 159 | - return false; |
|
| 160 | - } |
|
| 161 | - } |
|
| 148 | + /** |
|
| 149 | + * Checks if a child-node with the specified name exists |
|
| 150 | + * |
|
| 151 | + * @param string $name |
|
| 152 | + * @return bool |
|
| 153 | + */ |
|
| 154 | + public function childExists($name) { |
|
| 155 | + try { |
|
| 156 | + $this->commentsManager->get($name); |
|
| 157 | + return true; |
|
| 158 | + } catch (NotFoundException $e) { |
|
| 159 | + return false; |
|
| 160 | + } |
|
| 161 | + } |
|
| 162 | 162 | |
| 163 | - /** |
|
| 164 | - * Sets the read marker to the specified date for the logged in user |
|
| 165 | - * |
|
| 166 | - * @param \DateTime $value |
|
| 167 | - * @return bool |
|
| 168 | - */ |
|
| 169 | - public function setReadMarker($value) { |
|
| 170 | - $dateTime = new \DateTime($value); |
|
| 171 | - $user = $this->userSession->getUser(); |
|
| 172 | - $this->commentsManager->setReadMark($this->name, $this->id, $dateTime, $user); |
|
| 173 | - return true; |
|
| 174 | - } |
|
| 163 | + /** |
|
| 164 | + * Sets the read marker to the specified date for the logged in user |
|
| 165 | + * |
|
| 166 | + * @param \DateTime $value |
|
| 167 | + * @return bool |
|
| 168 | + */ |
|
| 169 | + public function setReadMarker($value) { |
|
| 170 | + $dateTime = new \DateTime($value); |
|
| 171 | + $user = $this->userSession->getUser(); |
|
| 172 | + $this->commentsManager->setReadMark($this->name, $this->id, $dateTime, $user); |
|
| 173 | + return true; |
|
| 174 | + } |
|
| 175 | 175 | |
| 176 | - /** |
|
| 177 | - * @inheritdoc |
|
| 178 | - */ |
|
| 179 | - public function propPatch(PropPatch $propPatch) { |
|
| 180 | - $propPatch->handle(self::PROPERTY_NAME_READ_MARKER, [$this, 'setReadMarker']); |
|
| 181 | - } |
|
| 176 | + /** |
|
| 177 | + * @inheritdoc |
|
| 178 | + */ |
|
| 179 | + public function propPatch(PropPatch $propPatch) { |
|
| 180 | + $propPatch->handle(self::PROPERTY_NAME_READ_MARKER, [$this, 'setReadMarker']); |
|
| 181 | + } |
|
| 182 | 182 | |
| 183 | - /** |
|
| 184 | - * @inheritdoc |
|
| 185 | - */ |
|
| 186 | - public function getProperties($properties) { |
|
| 187 | - $marker = null; |
|
| 188 | - $user = $this->userSession->getUser(); |
|
| 189 | - if (!is_null($user)) { |
|
| 190 | - $marker = $this->commentsManager->getReadMark($this->name, $this->id, $user); |
|
| 191 | - } |
|
| 192 | - return [self::PROPERTY_NAME_READ_MARKER => $marker]; |
|
| 193 | - } |
|
| 183 | + /** |
|
| 184 | + * @inheritdoc |
|
| 185 | + */ |
|
| 186 | + public function getProperties($properties) { |
|
| 187 | + $marker = null; |
|
| 188 | + $user = $this->userSession->getUser(); |
|
| 189 | + if (!is_null($user)) { |
|
| 190 | + $marker = $this->commentsManager->getReadMark($this->name, $this->id, $user); |
|
| 191 | + } |
|
| 192 | + return [self::PROPERTY_NAME_READ_MARKER => $marker]; |
|
| 193 | + } |
|
| 194 | 194 | } |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | $path = array_pop($path); |
| 78 | 78 | |
| 79 | 79 | $newName = \OC_Helper::buildNotExistingFileNameForView('/', $path, $this->view); |
| 80 | - $url = $request->getBaseUrl() . $newName; |
|
| 80 | + $url = $request->getBaseUrl().$newName; |
|
| 81 | 81 | $request->setUrl($url); |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -35,51 +35,51 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | class FilesDropPlugin extends ServerPlugin { |
| 37 | 37 | |
| 38 | - /** @var View */ |
|
| 39 | - private $view; |
|
| 38 | + /** @var View */ |
|
| 39 | + private $view; |
|
| 40 | 40 | |
| 41 | - /** @var bool */ |
|
| 42 | - private $enabled = false; |
|
| 41 | + /** @var bool */ |
|
| 42 | + private $enabled = false; |
|
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * @param View $view |
|
| 46 | - */ |
|
| 47 | - public function setView($view) { |
|
| 48 | - $this->view = $view; |
|
| 49 | - } |
|
| 44 | + /** |
|
| 45 | + * @param View $view |
|
| 46 | + */ |
|
| 47 | + public function setView($view) { |
|
| 48 | + $this->view = $view; |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - public function enable() { |
|
| 52 | - $this->enabled = true; |
|
| 53 | - } |
|
| 51 | + public function enable() { |
|
| 52 | + $this->enabled = true; |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * This initializes the plugin. |
|
| 58 | - * |
|
| 59 | - * @param \Sabre\DAV\Server $server Sabre server |
|
| 60 | - * |
|
| 61 | - * @return void |
|
| 62 | - * @throws MethodNotAllowed |
|
| 63 | - */ |
|
| 64 | - public function initialize(\Sabre\DAV\Server $server) { |
|
| 65 | - $server->on('beforeMethod:*', [$this, 'beforeMethod'], 999); |
|
| 66 | - $this->enabled = false; |
|
| 67 | - } |
|
| 56 | + /** |
|
| 57 | + * This initializes the plugin. |
|
| 58 | + * |
|
| 59 | + * @param \Sabre\DAV\Server $server Sabre server |
|
| 60 | + * |
|
| 61 | + * @return void |
|
| 62 | + * @throws MethodNotAllowed |
|
| 63 | + */ |
|
| 64 | + public function initialize(\Sabre\DAV\Server $server) { |
|
| 65 | + $server->on('beforeMethod:*', [$this, 'beforeMethod'], 999); |
|
| 66 | + $this->enabled = false; |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - public function beforeMethod(RequestInterface $request, ResponseInterface $response) { |
|
| 70 | - if (!$this->enabled) { |
|
| 71 | - return; |
|
| 72 | - } |
|
| 69 | + public function beforeMethod(RequestInterface $request, ResponseInterface $response) { |
|
| 70 | + if (!$this->enabled) { |
|
| 71 | + return; |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - if ($request->getMethod() !== 'PUT') { |
|
| 75 | - throw new MethodNotAllowed('Only PUT is allowed on files drop'); |
|
| 76 | - } |
|
| 74 | + if ($request->getMethod() !== 'PUT') { |
|
| 75 | + throw new MethodNotAllowed('Only PUT is allowed on files drop'); |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | - $path = explode('/', $request->getPath()); |
|
| 79 | - $path = array_pop($path); |
|
| 78 | + $path = explode('/', $request->getPath()); |
|
| 79 | + $path = array_pop($path); |
|
| 80 | 80 | |
| 81 | - $newName = \OC_Helper::buildNotExistingFileNameForView('/', $path, $this->view); |
|
| 82 | - $url = $request->getBaseUrl() . $newName; |
|
| 83 | - $request->setUrl($url); |
|
| 84 | - } |
|
| 81 | + $newName = \OC_Helper::buildNotExistingFileNameForView('/', $path, $this->view); |
|
| 82 | + $url = $request->getBaseUrl() . $newName; |
|
| 83 | + $request->setUrl($url); |
|
| 84 | + } |
|
| 85 | 85 | } |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | $output->writeln('Syncing users ...'); |
| 55 | 55 | $progress = new ProgressBar($output); |
| 56 | 56 | $progress->start(); |
| 57 | - $this->syncService->syncInstance(function () use ($progress) { |
|
| 57 | + $this->syncService->syncInstance(function() use ($progress) { |
|
| 58 | 58 | $progress->advance(); |
| 59 | 59 | }); |
| 60 | 60 | |
@@ -32,37 +32,37 @@ |
||
| 32 | 32 | |
| 33 | 33 | class SyncSystemAddressBook extends Command { |
| 34 | 34 | |
| 35 | - /** @var SyncService */ |
|
| 36 | - private $syncService; |
|
| 35 | + /** @var SyncService */ |
|
| 36 | + private $syncService; |
|
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * @param SyncService $syncService |
|
| 40 | - */ |
|
| 41 | - public function __construct(SyncService $syncService) { |
|
| 42 | - parent::__construct(); |
|
| 43 | - $this->syncService = $syncService; |
|
| 44 | - } |
|
| 38 | + /** |
|
| 39 | + * @param SyncService $syncService |
|
| 40 | + */ |
|
| 41 | + public function __construct(SyncService $syncService) { |
|
| 42 | + parent::__construct(); |
|
| 43 | + $this->syncService = $syncService; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - protected function configure() { |
|
| 47 | - $this |
|
| 48 | - ->setName('dav:sync-system-addressbook') |
|
| 49 | - ->setDescription('Synchronizes users to the system addressbook'); |
|
| 50 | - } |
|
| 46 | + protected function configure() { |
|
| 47 | + $this |
|
| 48 | + ->setName('dav:sync-system-addressbook') |
|
| 49 | + ->setDescription('Synchronizes users to the system addressbook'); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * @param InputInterface $input |
|
| 54 | - * @param OutputInterface $output |
|
| 55 | - */ |
|
| 56 | - protected function execute(InputInterface $input, OutputInterface $output): int { |
|
| 57 | - $output->writeln('Syncing users ...'); |
|
| 58 | - $progress = new ProgressBar($output); |
|
| 59 | - $progress->start(); |
|
| 60 | - $this->syncService->syncInstance(function () use ($progress) { |
|
| 61 | - $progress->advance(); |
|
| 62 | - }); |
|
| 52 | + /** |
|
| 53 | + * @param InputInterface $input |
|
| 54 | + * @param OutputInterface $output |
|
| 55 | + */ |
|
| 56 | + protected function execute(InputInterface $input, OutputInterface $output): int { |
|
| 57 | + $output->writeln('Syncing users ...'); |
|
| 58 | + $progress = new ProgressBar($output); |
|
| 59 | + $progress->start(); |
|
| 60 | + $this->syncService->syncInstance(function () use ($progress) { |
|
| 61 | + $progress->advance(); |
|
| 62 | + }); |
|
| 63 | 63 | |
| 64 | - $progress->finish(); |
|
| 65 | - $output->writeln(''); |
|
| 66 | - return 0; |
|
| 67 | - } |
|
| 64 | + $progress->finish(); |
|
| 65 | + $output->writeln(''); |
|
| 66 | + return 0; |
|
| 67 | + } |
|
| 68 | 68 | } |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | public function getChild($name) { |
| 59 | 59 | $elements = pathinfo($name); |
| 60 | 60 | $ext = isset($elements['extension']) ? $elements['extension'] : ''; |
| 61 | - $size = (int)(isset($elements['filename']) ? $elements['filename'] : '64'); |
|
| 61 | + $size = (int) (isset($elements['filename']) ? $elements['filename'] : '64'); |
|
| 62 | 62 | if (!in_array($ext, ['jpeg', 'png'], true)) { |
| 63 | 63 | throw new MethodNotAllowed('File format not allowed'); |
| 64 | 64 | } |
@@ -34,87 +34,87 @@ |
||
| 34 | 34 | |
| 35 | 35 | class AvatarHome implements ICollection { |
| 36 | 36 | |
| 37 | - /** @var array */ |
|
| 38 | - private $principalInfo; |
|
| 39 | - /** @var IAvatarManager */ |
|
| 40 | - private $avatarManager; |
|
| 37 | + /** @var array */ |
|
| 38 | + private $principalInfo; |
|
| 39 | + /** @var IAvatarManager */ |
|
| 40 | + private $avatarManager; |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * AvatarHome constructor. |
|
| 44 | - * |
|
| 45 | - * @param array $principalInfo |
|
| 46 | - * @param IAvatarManager $avatarManager |
|
| 47 | - */ |
|
| 48 | - public function __construct($principalInfo, IAvatarManager $avatarManager) { |
|
| 49 | - $this->principalInfo = $principalInfo; |
|
| 50 | - $this->avatarManager = $avatarManager; |
|
| 51 | - } |
|
| 42 | + /** |
|
| 43 | + * AvatarHome constructor. |
|
| 44 | + * |
|
| 45 | + * @param array $principalInfo |
|
| 46 | + * @param IAvatarManager $avatarManager |
|
| 47 | + */ |
|
| 48 | + public function __construct($principalInfo, IAvatarManager $avatarManager) { |
|
| 49 | + $this->principalInfo = $principalInfo; |
|
| 50 | + $this->avatarManager = $avatarManager; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - public function createFile($name, $data = null) { |
|
| 54 | - throw new Forbidden('Permission denied to create a file'); |
|
| 55 | - } |
|
| 53 | + public function createFile($name, $data = null) { |
|
| 54 | + throw new Forbidden('Permission denied to create a file'); |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - public function createDirectory($name) { |
|
| 58 | - throw new Forbidden('Permission denied to create a folder'); |
|
| 59 | - } |
|
| 57 | + public function createDirectory($name) { |
|
| 58 | + throw new Forbidden('Permission denied to create a folder'); |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - public function getChild($name) { |
|
| 62 | - $elements = pathinfo($name); |
|
| 63 | - $ext = isset($elements['extension']) ? $elements['extension'] : ''; |
|
| 64 | - $size = (int)(isset($elements['filename']) ? $elements['filename'] : '64'); |
|
| 65 | - if (!in_array($ext, ['jpeg', 'png'], true)) { |
|
| 66 | - throw new MethodNotAllowed('File format not allowed'); |
|
| 67 | - } |
|
| 68 | - if ($size <= 0 || $size > 1024) { |
|
| 69 | - throw new MethodNotAllowed('Invalid image size'); |
|
| 70 | - } |
|
| 71 | - $avatar = $this->avatarManager->getAvatar($this->getName()); |
|
| 72 | - if (!$avatar->exists()) { |
|
| 73 | - throw new NotFound(); |
|
| 74 | - } |
|
| 75 | - return new AvatarNode($size, $ext, $avatar); |
|
| 76 | - } |
|
| 61 | + public function getChild($name) { |
|
| 62 | + $elements = pathinfo($name); |
|
| 63 | + $ext = isset($elements['extension']) ? $elements['extension'] : ''; |
|
| 64 | + $size = (int)(isset($elements['filename']) ? $elements['filename'] : '64'); |
|
| 65 | + if (!in_array($ext, ['jpeg', 'png'], true)) { |
|
| 66 | + throw new MethodNotAllowed('File format not allowed'); |
|
| 67 | + } |
|
| 68 | + if ($size <= 0 || $size > 1024) { |
|
| 69 | + throw new MethodNotAllowed('Invalid image size'); |
|
| 70 | + } |
|
| 71 | + $avatar = $this->avatarManager->getAvatar($this->getName()); |
|
| 72 | + if (!$avatar->exists()) { |
|
| 73 | + throw new NotFound(); |
|
| 74 | + } |
|
| 75 | + return new AvatarNode($size, $ext, $avatar); |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | - public function getChildren() { |
|
| 79 | - try { |
|
| 80 | - return [ |
|
| 81 | - $this->getChild('96.jpeg') |
|
| 82 | - ]; |
|
| 83 | - } catch (NotFound $exception) { |
|
| 84 | - return []; |
|
| 85 | - } |
|
| 86 | - } |
|
| 78 | + public function getChildren() { |
|
| 79 | + try { |
|
| 80 | + return [ |
|
| 81 | + $this->getChild('96.jpeg') |
|
| 82 | + ]; |
|
| 83 | + } catch (NotFound $exception) { |
|
| 84 | + return []; |
|
| 85 | + } |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | - public function childExists($name) { |
|
| 89 | - try { |
|
| 90 | - $ret = $this->getChild($name); |
|
| 91 | - return $ret !== null; |
|
| 92 | - } catch (NotFound $ex) { |
|
| 93 | - return false; |
|
| 94 | - } catch (MethodNotAllowed $ex) { |
|
| 95 | - return false; |
|
| 96 | - } |
|
| 97 | - } |
|
| 88 | + public function childExists($name) { |
|
| 89 | + try { |
|
| 90 | + $ret = $this->getChild($name); |
|
| 91 | + return $ret !== null; |
|
| 92 | + } catch (NotFound $ex) { |
|
| 93 | + return false; |
|
| 94 | + } catch (MethodNotAllowed $ex) { |
|
| 95 | + return false; |
|
| 96 | + } |
|
| 97 | + } |
|
| 98 | 98 | |
| 99 | - public function delete() { |
|
| 100 | - throw new Forbidden('Permission denied to delete this folder'); |
|
| 101 | - } |
|
| 99 | + public function delete() { |
|
| 100 | + throw new Forbidden('Permission denied to delete this folder'); |
|
| 101 | + } |
|
| 102 | 102 | |
| 103 | - public function getName() { |
|
| 104 | - [,$name] = Uri\split($this->principalInfo['uri']); |
|
| 105 | - return $name; |
|
| 106 | - } |
|
| 103 | + public function getName() { |
|
| 104 | + [,$name] = Uri\split($this->principalInfo['uri']); |
|
| 105 | + return $name; |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | - public function setName($name) { |
|
| 109 | - throw new Forbidden('Permission denied to rename this folder'); |
|
| 110 | - } |
|
| 108 | + public function setName($name) { |
|
| 109 | + throw new Forbidden('Permission denied to rename this folder'); |
|
| 110 | + } |
|
| 111 | 111 | |
| 112 | - /** |
|
| 113 | - * Returns the last modification time, as a unix timestamp |
|
| 114 | - * |
|
| 115 | - * @return int|null |
|
| 116 | - */ |
|
| 117 | - public function getLastModified() { |
|
| 118 | - return null; |
|
| 119 | - } |
|
| 112 | + /** |
|
| 113 | + * Returns the last modification time, as a unix timestamp |
|
| 114 | + * |
|
| 115 | + * @return int|null |
|
| 116 | + */ |
|
| 117 | + public function getLastModified() { |
|
| 118 | + return null; |
|
| 119 | + } |
|
| 120 | 120 | } |
@@ -26,71 +26,71 @@ |
||
| 26 | 26 | use Sabre\DAV\File; |
| 27 | 27 | |
| 28 | 28 | class AvatarNode extends File { |
| 29 | - private $ext; |
|
| 30 | - private $size; |
|
| 31 | - private $avatar; |
|
| 29 | + private $ext; |
|
| 30 | + private $size; |
|
| 31 | + private $avatar; |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * AvatarNode constructor. |
|
| 35 | - * |
|
| 36 | - * @param integer $size |
|
| 37 | - * @param string $ext |
|
| 38 | - * @param IAvatar $avatar |
|
| 39 | - */ |
|
| 40 | - public function __construct($size, $ext, $avatar) { |
|
| 41 | - $this->size = $size; |
|
| 42 | - $this->ext = $ext; |
|
| 43 | - $this->avatar = $avatar; |
|
| 44 | - } |
|
| 33 | + /** |
|
| 34 | + * AvatarNode constructor. |
|
| 35 | + * |
|
| 36 | + * @param integer $size |
|
| 37 | + * @param string $ext |
|
| 38 | + * @param IAvatar $avatar |
|
| 39 | + */ |
|
| 40 | + public function __construct($size, $ext, $avatar) { |
|
| 41 | + $this->size = $size; |
|
| 42 | + $this->ext = $ext; |
|
| 43 | + $this->avatar = $avatar; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * Returns the name of the node. |
|
| 48 | - * |
|
| 49 | - * This is used to generate the url. |
|
| 50 | - * |
|
| 51 | - * @return string |
|
| 52 | - */ |
|
| 53 | - public function getName() { |
|
| 54 | - return "$this->size.$this->ext"; |
|
| 55 | - } |
|
| 46 | + /** |
|
| 47 | + * Returns the name of the node. |
|
| 48 | + * |
|
| 49 | + * This is used to generate the url. |
|
| 50 | + * |
|
| 51 | + * @return string |
|
| 52 | + */ |
|
| 53 | + public function getName() { |
|
| 54 | + return "$this->size.$this->ext"; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - public function get() { |
|
| 58 | - $image = $this->avatar->get($this->size); |
|
| 59 | - $res = $image->resource(); |
|
| 57 | + public function get() { |
|
| 58 | + $image = $this->avatar->get($this->size); |
|
| 59 | + $res = $image->resource(); |
|
| 60 | 60 | |
| 61 | - ob_start(); |
|
| 62 | - if ($this->ext === 'png') { |
|
| 63 | - imagepng($res); |
|
| 64 | - } else { |
|
| 65 | - imagejpeg($res); |
|
| 66 | - } |
|
| 61 | + ob_start(); |
|
| 62 | + if ($this->ext === 'png') { |
|
| 63 | + imagepng($res); |
|
| 64 | + } else { |
|
| 65 | + imagejpeg($res); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - return ob_get_clean(); |
|
| 69 | - } |
|
| 68 | + return ob_get_clean(); |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - /** |
|
| 72 | - * Returns the mime-type for a file |
|
| 73 | - * |
|
| 74 | - * If null is returned, we'll assume application/octet-stream |
|
| 75 | - * |
|
| 76 | - * @return string|null |
|
| 77 | - */ |
|
| 78 | - public function getContentType() { |
|
| 79 | - if ($this->ext === 'png') { |
|
| 80 | - return 'image/png'; |
|
| 81 | - } |
|
| 82 | - return 'image/jpeg'; |
|
| 83 | - } |
|
| 71 | + /** |
|
| 72 | + * Returns the mime-type for a file |
|
| 73 | + * |
|
| 74 | + * If null is returned, we'll assume application/octet-stream |
|
| 75 | + * |
|
| 76 | + * @return string|null |
|
| 77 | + */ |
|
| 78 | + public function getContentType() { |
|
| 79 | + if ($this->ext === 'png') { |
|
| 80 | + return 'image/png'; |
|
| 81 | + } |
|
| 82 | + return 'image/jpeg'; |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | - public function getETag() { |
|
| 86 | - return $this->avatar->getFile($this->size)->getEtag(); |
|
| 87 | - } |
|
| 85 | + public function getETag() { |
|
| 86 | + return $this->avatar->getFile($this->size)->getEtag(); |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - public function getLastModified() { |
|
| 90 | - $timestamp = $this->avatar->getFile($this->size)->getMTime(); |
|
| 91 | - if (!empty($timestamp)) { |
|
| 92 | - return (int)$timestamp; |
|
| 93 | - } |
|
| 94 | - return $timestamp; |
|
| 95 | - } |
|
| 89 | + public function getLastModified() { |
|
| 90 | + $timestamp = $this->avatar->getFile($this->size)->getMTime(); |
|
| 91 | + if (!empty($timestamp)) { |
|
| 92 | + return (int)$timestamp; |
|
| 93 | + } |
|
| 94 | + return $timestamp; |
|
| 95 | + } |
|
| 96 | 96 | } |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | public function getLastModified() { |
| 90 | 90 | $timestamp = $this->avatar->getFile($this->size)->getMTime(); |
| 91 | 91 | if (!empty($timestamp)) { |
| 92 | - return (int)$timestamp; |
|
| 92 | + return (int) $timestamp; |
|
| 93 | 93 | } |
| 94 | 94 | return $timestamp; |
| 95 | 95 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | |
| 40 | 40 | public function xmlSerialize(Writer $writer) { |
| 41 | 41 | foreach ($this->groups as $group) { |
| 42 | - $writer->writeElement('{' . self::NS_OWNCLOUD . '}group', $group); |
|
| 42 | + $writer->writeElement('{'.self::NS_OWNCLOUD.'}group', $group); |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -27,21 +27,21 @@ |
||
| 27 | 27 | use Sabre\Xml\XmlSerializable; |
| 28 | 28 | |
| 29 | 29 | class Groups implements XmlSerializable { |
| 30 | - public const NS_OWNCLOUD = 'http://owncloud.org/ns'; |
|
| 30 | + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; |
|
| 31 | 31 | |
| 32 | - /** @var string[] of TYPE:CHECKSUM */ |
|
| 33 | - private $groups; |
|
| 32 | + /** @var string[] of TYPE:CHECKSUM */ |
|
| 33 | + private $groups; |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * @param string $groups |
|
| 37 | - */ |
|
| 38 | - public function __construct($groups) { |
|
| 39 | - $this->groups = $groups; |
|
| 40 | - } |
|
| 35 | + /** |
|
| 36 | + * @param string $groups |
|
| 37 | + */ |
|
| 38 | + public function __construct($groups) { |
|
| 39 | + $this->groups = $groups; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - public function xmlSerialize(Writer $writer) { |
|
| 43 | - foreach ($this->groups as $group) { |
|
| 44 | - $writer->writeElement('{' . self::NS_OWNCLOUD . '}group', $group); |
|
| 45 | - } |
|
| 46 | - } |
|
| 42 | + public function xmlSerialize(Writer $writer) { |
|
| 43 | + foreach ($this->groups as $group) { |
|
| 44 | + $writer->writeElement('{' . self::NS_OWNCLOUD . '}group', $group); |
|
| 45 | + } |
|
| 46 | + } |
|
| 47 | 47 | } |
@@ -116,42 +116,42 @@ |
||
| 116 | 116 | * @return void |
| 117 | 117 | */ |
| 118 | 118 | public function xmlSerialize(Writer $writer) { |
| 119 | - $cs = '{' . Plugin::NS_OWNCLOUD . '}'; |
|
| 119 | + $cs = '{'.Plugin::NS_OWNCLOUD.'}'; |
|
| 120 | 120 | |
| 121 | 121 | if (!is_null($this->organizer)) { |
| 122 | - $writer->startElement($cs . 'organizer'); |
|
| 122 | + $writer->startElement($cs.'organizer'); |
|
| 123 | 123 | $writer->writeElement('{DAV:}href', $this->organizer['href']); |
| 124 | 124 | |
| 125 | 125 | if (isset($this->organizer['commonName']) && $this->organizer['commonName']) { |
| 126 | - $writer->writeElement($cs . 'common-name', $this->organizer['commonName']); |
|
| 126 | + $writer->writeElement($cs.'common-name', $this->organizer['commonName']); |
|
| 127 | 127 | } |
| 128 | 128 | if (isset($this->organizer['firstName']) && $this->organizer['firstName']) { |
| 129 | - $writer->writeElement($cs . 'first-name', $this->organizer['firstName']); |
|
| 129 | + $writer->writeElement($cs.'first-name', $this->organizer['firstName']); |
|
| 130 | 130 | } |
| 131 | 131 | if (isset($this->organizer['lastName']) && $this->organizer['lastName']) { |
| 132 | - $writer->writeElement($cs . 'last-name', $this->organizer['lastName']); |
|
| 132 | + $writer->writeElement($cs.'last-name', $this->organizer['lastName']); |
|
| 133 | 133 | } |
| 134 | 134 | $writer->endElement(); // organizer |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | foreach ($this->users as $user) { |
| 138 | - $writer->startElement($cs . 'user'); |
|
| 138 | + $writer->startElement($cs.'user'); |
|
| 139 | 139 | $writer->writeElement('{DAV:}href', $user['href']); |
| 140 | 140 | if (isset($user['commonName']) && $user['commonName']) { |
| 141 | - $writer->writeElement($cs . 'common-name', $user['commonName']); |
|
| 141 | + $writer->writeElement($cs.'common-name', $user['commonName']); |
|
| 142 | 142 | } |
| 143 | - $writer->writeElement($cs . 'invite-accepted'); |
|
| 143 | + $writer->writeElement($cs.'invite-accepted'); |
|
| 144 | 144 | |
| 145 | - $writer->startElement($cs . 'access'); |
|
| 145 | + $writer->startElement($cs.'access'); |
|
| 146 | 146 | if ($user['readOnly']) { |
| 147 | - $writer->writeElement($cs . 'read'); |
|
| 147 | + $writer->writeElement($cs.'read'); |
|
| 148 | 148 | } else { |
| 149 | - $writer->writeElement($cs . 'read-write'); |
|
| 149 | + $writer->writeElement($cs.'read-write'); |
|
| 150 | 150 | } |
| 151 | 151 | $writer->endElement(); // access |
| 152 | 152 | |
| 153 | 153 | if (isset($user['summary']) && $user['summary']) { |
| 154 | - $writer->writeElement($cs . 'summary', $user['summary']); |
|
| 154 | + $writer->writeElement($cs.'summary', $user['summary']); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | $writer->endElement(); //user |
@@ -44,120 +44,120 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | class Invite implements XmlSerializable { |
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * The list of users a calendar has been shared to. |
|
| 49 | - * |
|
| 50 | - * @var array |
|
| 51 | - */ |
|
| 52 | - protected $users; |
|
| 47 | + /** |
|
| 48 | + * The list of users a calendar has been shared to. |
|
| 49 | + * |
|
| 50 | + * @var array |
|
| 51 | + */ |
|
| 52 | + protected $users; |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * The organizer contains information about the person who shared the |
|
| 56 | - * object. |
|
| 57 | - * |
|
| 58 | - * @var array|null |
|
| 59 | - */ |
|
| 60 | - protected $organizer; |
|
| 54 | + /** |
|
| 55 | + * The organizer contains information about the person who shared the |
|
| 56 | + * object. |
|
| 57 | + * |
|
| 58 | + * @var array|null |
|
| 59 | + */ |
|
| 60 | + protected $organizer; |
|
| 61 | 61 | |
| 62 | - /** |
|
| 63 | - * Creates the property. |
|
| 64 | - * |
|
| 65 | - * Users is an array. Each element of the array has the following |
|
| 66 | - * properties: |
|
| 67 | - * |
|
| 68 | - * * href - Often a mailto: address |
|
| 69 | - * * commonName - Optional, for example a first and lastname for a user. |
|
| 70 | - * * status - One of the SharingPlugin::STATUS_* constants. |
|
| 71 | - * * readOnly - true or false |
|
| 72 | - * * summary - Optional, description of the share |
|
| 73 | - * |
|
| 74 | - * The organizer key is optional to specify. It's only useful when a |
|
| 75 | - * 'sharee' requests the sharing information. |
|
| 76 | - * |
|
| 77 | - * The organizer may have the following properties: |
|
| 78 | - * * href - Often a mailto: address. |
|
| 79 | - * * commonName - Optional human-readable name. |
|
| 80 | - * * firstName - Optional first name. |
|
| 81 | - * * lastName - Optional last name. |
|
| 82 | - * |
|
| 83 | - * If you wonder why these two structures are so different, I guess a |
|
| 84 | - * valid answer is that the current spec is still a draft. |
|
| 85 | - * |
|
| 86 | - * @param array $users |
|
| 87 | - */ |
|
| 88 | - public function __construct(array $users, array $organizer = null) { |
|
| 89 | - $this->users = $users; |
|
| 90 | - $this->organizer = $organizer; |
|
| 91 | - } |
|
| 62 | + /** |
|
| 63 | + * Creates the property. |
|
| 64 | + * |
|
| 65 | + * Users is an array. Each element of the array has the following |
|
| 66 | + * properties: |
|
| 67 | + * |
|
| 68 | + * * href - Often a mailto: address |
|
| 69 | + * * commonName - Optional, for example a first and lastname for a user. |
|
| 70 | + * * status - One of the SharingPlugin::STATUS_* constants. |
|
| 71 | + * * readOnly - true or false |
|
| 72 | + * * summary - Optional, description of the share |
|
| 73 | + * |
|
| 74 | + * The organizer key is optional to specify. It's only useful when a |
|
| 75 | + * 'sharee' requests the sharing information. |
|
| 76 | + * |
|
| 77 | + * The organizer may have the following properties: |
|
| 78 | + * * href - Often a mailto: address. |
|
| 79 | + * * commonName - Optional human-readable name. |
|
| 80 | + * * firstName - Optional first name. |
|
| 81 | + * * lastName - Optional last name. |
|
| 82 | + * |
|
| 83 | + * If you wonder why these two structures are so different, I guess a |
|
| 84 | + * valid answer is that the current spec is still a draft. |
|
| 85 | + * |
|
| 86 | + * @param array $users |
|
| 87 | + */ |
|
| 88 | + public function __construct(array $users, array $organizer = null) { |
|
| 89 | + $this->users = $users; |
|
| 90 | + $this->organizer = $organizer; |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - /** |
|
| 94 | - * Returns the list of users, as it was passed to the constructor. |
|
| 95 | - * |
|
| 96 | - * @return array |
|
| 97 | - */ |
|
| 98 | - public function getValue() { |
|
| 99 | - return $this->users; |
|
| 100 | - } |
|
| 93 | + /** |
|
| 94 | + * Returns the list of users, as it was passed to the constructor. |
|
| 95 | + * |
|
| 96 | + * @return array |
|
| 97 | + */ |
|
| 98 | + public function getValue() { |
|
| 99 | + return $this->users; |
|
| 100 | + } |
|
| 101 | 101 | |
| 102 | - /** |
|
| 103 | - * The xmlSerialize method is called during xml writing. |
|
| 104 | - * |
|
| 105 | - * Use the $writer argument to write its own xml serialization. |
|
| 106 | - * |
|
| 107 | - * An important note: do _not_ create a parent element. Any element |
|
| 108 | - * implementing XmlSerializble should only ever write what's considered |
|
| 109 | - * its 'inner xml'. |
|
| 110 | - * |
|
| 111 | - * The parent of the current element is responsible for writing a |
|
| 112 | - * containing element. |
|
| 113 | - * |
|
| 114 | - * This allows serializers to be re-used for different element names. |
|
| 115 | - * |
|
| 116 | - * If you are opening new elements, you must also close them again. |
|
| 117 | - * |
|
| 118 | - * @param Writer $writer |
|
| 119 | - * @return void |
|
| 120 | - */ |
|
| 121 | - public function xmlSerialize(Writer $writer) { |
|
| 122 | - $cs = '{' . Plugin::NS_OWNCLOUD . '}'; |
|
| 102 | + /** |
|
| 103 | + * The xmlSerialize method is called during xml writing. |
|
| 104 | + * |
|
| 105 | + * Use the $writer argument to write its own xml serialization. |
|
| 106 | + * |
|
| 107 | + * An important note: do _not_ create a parent element. Any element |
|
| 108 | + * implementing XmlSerializble should only ever write what's considered |
|
| 109 | + * its 'inner xml'. |
|
| 110 | + * |
|
| 111 | + * The parent of the current element is responsible for writing a |
|
| 112 | + * containing element. |
|
| 113 | + * |
|
| 114 | + * This allows serializers to be re-used for different element names. |
|
| 115 | + * |
|
| 116 | + * If you are opening new elements, you must also close them again. |
|
| 117 | + * |
|
| 118 | + * @param Writer $writer |
|
| 119 | + * @return void |
|
| 120 | + */ |
|
| 121 | + public function xmlSerialize(Writer $writer) { |
|
| 122 | + $cs = '{' . Plugin::NS_OWNCLOUD . '}'; |
|
| 123 | 123 | |
| 124 | - if (!is_null($this->organizer)) { |
|
| 125 | - $writer->startElement($cs . 'organizer'); |
|
| 126 | - $writer->writeElement('{DAV:}href', $this->organizer['href']); |
|
| 124 | + if (!is_null($this->organizer)) { |
|
| 125 | + $writer->startElement($cs . 'organizer'); |
|
| 126 | + $writer->writeElement('{DAV:}href', $this->organizer['href']); |
|
| 127 | 127 | |
| 128 | - if (isset($this->organizer['commonName']) && $this->organizer['commonName']) { |
|
| 129 | - $writer->writeElement($cs . 'common-name', $this->organizer['commonName']); |
|
| 130 | - } |
|
| 131 | - if (isset($this->organizer['firstName']) && $this->organizer['firstName']) { |
|
| 132 | - $writer->writeElement($cs . 'first-name', $this->organizer['firstName']); |
|
| 133 | - } |
|
| 134 | - if (isset($this->organizer['lastName']) && $this->organizer['lastName']) { |
|
| 135 | - $writer->writeElement($cs . 'last-name', $this->organizer['lastName']); |
|
| 136 | - } |
|
| 137 | - $writer->endElement(); // organizer |
|
| 138 | - } |
|
| 128 | + if (isset($this->organizer['commonName']) && $this->organizer['commonName']) { |
|
| 129 | + $writer->writeElement($cs . 'common-name', $this->organizer['commonName']); |
|
| 130 | + } |
|
| 131 | + if (isset($this->organizer['firstName']) && $this->organizer['firstName']) { |
|
| 132 | + $writer->writeElement($cs . 'first-name', $this->organizer['firstName']); |
|
| 133 | + } |
|
| 134 | + if (isset($this->organizer['lastName']) && $this->organizer['lastName']) { |
|
| 135 | + $writer->writeElement($cs . 'last-name', $this->organizer['lastName']); |
|
| 136 | + } |
|
| 137 | + $writer->endElement(); // organizer |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | - foreach ($this->users as $user) { |
|
| 141 | - $writer->startElement($cs . 'user'); |
|
| 142 | - $writer->writeElement('{DAV:}href', $user['href']); |
|
| 143 | - if (isset($user['commonName']) && $user['commonName']) { |
|
| 144 | - $writer->writeElement($cs . 'common-name', $user['commonName']); |
|
| 145 | - } |
|
| 146 | - $writer->writeElement($cs . 'invite-accepted'); |
|
| 140 | + foreach ($this->users as $user) { |
|
| 141 | + $writer->startElement($cs . 'user'); |
|
| 142 | + $writer->writeElement('{DAV:}href', $user['href']); |
|
| 143 | + if (isset($user['commonName']) && $user['commonName']) { |
|
| 144 | + $writer->writeElement($cs . 'common-name', $user['commonName']); |
|
| 145 | + } |
|
| 146 | + $writer->writeElement($cs . 'invite-accepted'); |
|
| 147 | 147 | |
| 148 | - $writer->startElement($cs . 'access'); |
|
| 149 | - if ($user['readOnly']) { |
|
| 150 | - $writer->writeElement($cs . 'read'); |
|
| 151 | - } else { |
|
| 152 | - $writer->writeElement($cs . 'read-write'); |
|
| 153 | - } |
|
| 154 | - $writer->endElement(); // access |
|
| 148 | + $writer->startElement($cs . 'access'); |
|
| 149 | + if ($user['readOnly']) { |
|
| 150 | + $writer->writeElement($cs . 'read'); |
|
| 151 | + } else { |
|
| 152 | + $writer->writeElement($cs . 'read-write'); |
|
| 153 | + } |
|
| 154 | + $writer->endElement(); // access |
|
| 155 | 155 | |
| 156 | - if (isset($user['summary']) && $user['summary']) { |
|
| 157 | - $writer->writeElement($cs . 'summary', $user['summary']); |
|
| 158 | - } |
|
| 156 | + if (isset($user['summary']) && $user['summary']) { |
|
| 157 | + $writer->writeElement($cs . 'summary', $user['summary']); |
|
| 158 | + } |
|
| 159 | 159 | |
| 160 | - $writer->endElement(); //user |
|
| 161 | - } |
|
| 162 | - } |
|
| 160 | + $writer->endElement(); //user |
|
| 161 | + } |
|
| 162 | + } |
|
| 163 | 163 | } |
@@ -26,54 +26,54 @@ |
||
| 26 | 26 | use Sabre\Xml\XmlDeserializable; |
| 27 | 27 | |
| 28 | 28 | class ShareRequest implements XmlDeserializable { |
| 29 | - public $set = []; |
|
| 29 | + public $set = []; |
|
| 30 | 30 | |
| 31 | - public $remove = []; |
|
| 31 | + public $remove = []; |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Constructor |
|
| 35 | - * |
|
| 36 | - * @param array $set |
|
| 37 | - * @param array $remove |
|
| 38 | - */ |
|
| 39 | - public function __construct(array $set, array $remove) { |
|
| 40 | - $this->set = $set; |
|
| 41 | - $this->remove = $remove; |
|
| 42 | - } |
|
| 33 | + /** |
|
| 34 | + * Constructor |
|
| 35 | + * |
|
| 36 | + * @param array $set |
|
| 37 | + * @param array $remove |
|
| 38 | + */ |
|
| 39 | + public function __construct(array $set, array $remove) { |
|
| 40 | + $this->set = $set; |
|
| 41 | + $this->remove = $remove; |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - public static function xmlDeserialize(Reader $reader) { |
|
| 45 | - $elements = $reader->parseInnerTree([ |
|
| 46 | - '{' . Plugin::NS_OWNCLOUD. '}set' => 'Sabre\\Xml\\Element\\KeyValue', |
|
| 47 | - '{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue', |
|
| 48 | - ]); |
|
| 44 | + public static function xmlDeserialize(Reader $reader) { |
|
| 45 | + $elements = $reader->parseInnerTree([ |
|
| 46 | + '{' . Plugin::NS_OWNCLOUD. '}set' => 'Sabre\\Xml\\Element\\KeyValue', |
|
| 47 | + '{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue', |
|
| 48 | + ]); |
|
| 49 | 49 | |
| 50 | - $set = []; |
|
| 51 | - $remove = []; |
|
| 50 | + $set = []; |
|
| 51 | + $remove = []; |
|
| 52 | 52 | |
| 53 | - foreach ($elements as $elem) { |
|
| 54 | - switch ($elem['name']) { |
|
| 53 | + foreach ($elements as $elem) { |
|
| 54 | + switch ($elem['name']) { |
|
| 55 | 55 | |
| 56 | - case '{' . Plugin::NS_OWNCLOUD . '}set': |
|
| 57 | - $sharee = $elem['value']; |
|
| 56 | + case '{' . Plugin::NS_OWNCLOUD . '}set': |
|
| 57 | + $sharee = $elem['value']; |
|
| 58 | 58 | |
| 59 | - $sumElem = '{' . Plugin::NS_OWNCLOUD . '}summary'; |
|
| 60 | - $commonName = '{' . Plugin::NS_OWNCLOUD . '}common-name'; |
|
| 59 | + $sumElem = '{' . Plugin::NS_OWNCLOUD . '}summary'; |
|
| 60 | + $commonName = '{' . Plugin::NS_OWNCLOUD . '}common-name'; |
|
| 61 | 61 | |
| 62 | - $set[] = [ |
|
| 63 | - 'href' => $sharee['{DAV:}href'], |
|
| 64 | - 'commonName' => isset($sharee[$commonName]) ? $sharee[$commonName] : null, |
|
| 65 | - 'summary' => isset($sharee[$sumElem]) ? $sharee[$sumElem] : null, |
|
| 66 | - 'readOnly' => !array_key_exists('{' . Plugin::NS_OWNCLOUD . '}read-write', $sharee), |
|
| 67 | - ]; |
|
| 68 | - break; |
|
| 62 | + $set[] = [ |
|
| 63 | + 'href' => $sharee['{DAV:}href'], |
|
| 64 | + 'commonName' => isset($sharee[$commonName]) ? $sharee[$commonName] : null, |
|
| 65 | + 'summary' => isset($sharee[$sumElem]) ? $sharee[$sumElem] : null, |
|
| 66 | + 'readOnly' => !array_key_exists('{' . Plugin::NS_OWNCLOUD . '}read-write', $sharee), |
|
| 67 | + ]; |
|
| 68 | + break; |
|
| 69 | 69 | |
| 70 | - case '{' . Plugin::NS_OWNCLOUD . '}remove': |
|
| 71 | - $remove[] = $elem['value']['{DAV:}href']; |
|
| 72 | - break; |
|
| 70 | + case '{' . Plugin::NS_OWNCLOUD . '}remove': |
|
| 71 | + $remove[] = $elem['value']['{DAV:}href']; |
|
| 72 | + break; |
|
| 73 | 73 | |
| 74 | - } |
|
| 75 | - } |
|
| 74 | + } |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - return new self($set, $remove); |
|
| 78 | - } |
|
| 77 | + return new self($set, $remove); |
|
| 78 | + } |
|
| 79 | 79 | } |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | public static function xmlDeserialize(Reader $reader) { |
| 45 | 45 | $elements = $reader->parseInnerTree([ |
| 46 | - '{' . Plugin::NS_OWNCLOUD. '}set' => 'Sabre\\Xml\\Element\\KeyValue', |
|
| 47 | - '{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue', |
|
| 46 | + '{'.Plugin::NS_OWNCLOUD.'}set' => 'Sabre\\Xml\\Element\\KeyValue', |
|
| 47 | + '{'.Plugin::NS_OWNCLOUD.'}remove' => 'Sabre\\Xml\\Element\\KeyValue', |
|
| 48 | 48 | ]); |
| 49 | 49 | |
| 50 | 50 | $set = []; |
@@ -53,21 +53,21 @@ discard block |
||
| 53 | 53 | foreach ($elements as $elem) { |
| 54 | 54 | switch ($elem['name']) { |
| 55 | 55 | |
| 56 | - case '{' . Plugin::NS_OWNCLOUD . '}set': |
|
| 56 | + case '{'.Plugin::NS_OWNCLOUD.'}set': |
|
| 57 | 57 | $sharee = $elem['value']; |
| 58 | 58 | |
| 59 | - $sumElem = '{' . Plugin::NS_OWNCLOUD . '}summary'; |
|
| 60 | - $commonName = '{' . Plugin::NS_OWNCLOUD . '}common-name'; |
|
| 59 | + $sumElem = '{'.Plugin::NS_OWNCLOUD.'}summary'; |
|
| 60 | + $commonName = '{'.Plugin::NS_OWNCLOUD.'}common-name'; |
|
| 61 | 61 | |
| 62 | 62 | $set[] = [ |
| 63 | 63 | 'href' => $sharee['{DAV:}href'], |
| 64 | 64 | 'commonName' => isset($sharee[$commonName]) ? $sharee[$commonName] : null, |
| 65 | 65 | 'summary' => isset($sharee[$sumElem]) ? $sharee[$sumElem] : null, |
| 66 | - 'readOnly' => !array_key_exists('{' . Plugin::NS_OWNCLOUD . '}read-write', $sharee), |
|
| 66 | + 'readOnly' => !array_key_exists('{'.Plugin::NS_OWNCLOUD.'}read-write', $sharee), |
|
| 67 | 67 | ]; |
| 68 | 68 | break; |
| 69 | 69 | |
| 70 | - case '{' . Plugin::NS_OWNCLOUD . '}remove': |
|
| 70 | + case '{'.Plugin::NS_OWNCLOUD.'}remove': |
|
| 71 | 71 | $remove[] = $elem['value']['{DAV:}href']; |
| 72 | 72 | break; |
| 73 | 73 | |