@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | 'targetUser' => $recipient, |
113 | 113 | 'nodeName' => $node->getName(), |
114 | 114 | ]) |
115 | - ->setObject('transfer', (string)$transferOwnership->getId()); |
|
115 | + ->setObject('transfer', (string) $transferOwnership->getId()); |
|
116 | 116 | |
117 | 117 | $this->notificationManager->notify($notification); |
118 | 118 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | $notification = $this->notificationManager->createNotification(); |
137 | 137 | $notification->setApp('files') |
138 | - ->setObject('transfer', (string)$id); |
|
138 | + ->setObject('transfer', (string) $id); |
|
139 | 139 | $this->notificationManager->markProcessed($notification); |
140 | 140 | |
141 | 141 | $newTransferOwnership = new TransferOwnershipEntity(); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | $notification = $this->notificationManager->createNotification(); |
170 | 170 | $notification->setApp('files') |
171 | - ->setObject('transfer', (string)$id); |
|
171 | + ->setObject('transfer', (string) $id); |
|
172 | 172 | $this->notificationManager->markProcessed($notification); |
173 | 173 | |
174 | 174 | $notification = $this->notificationManager->createNotification(); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | 'targetUser' => $transferOwnership->getTargetUser(), |
181 | 181 | 'nodeName' => $transferOwnership->getNodeName() |
182 | 182 | ]) |
183 | - ->setObject('transfer', (string)$transferOwnership->getId()); |
|
183 | + ->setObject('transfer', (string) $transferOwnership->getId()); |
|
184 | 184 | $this->notificationManager->notify($notification); |
185 | 185 | |
186 | 186 | $this->mapper->delete($transferOwnership); |
@@ -44,153 +44,153 @@ |
||
44 | 44 | |
45 | 45 | class TransferOwnershipController extends OCSController { |
46 | 46 | |
47 | - /** @var string */ |
|
48 | - private $userId; |
|
49 | - /** @var NotificationManager */ |
|
50 | - private $notificationManager; |
|
51 | - /** @var ITimeFactory */ |
|
52 | - private $timeFactory; |
|
53 | - /** @var IJobList */ |
|
54 | - private $jobList; |
|
55 | - /** @var TransferOwnershipMapper */ |
|
56 | - private $mapper; |
|
57 | - /** @var IUserManager */ |
|
58 | - private $userManager; |
|
59 | - /** @var IRootFolder */ |
|
60 | - private $rootFolder; |
|
61 | - |
|
62 | - public function __construct(string $appName, |
|
63 | - IRequest $request, |
|
64 | - string $userId, |
|
65 | - NotificationManager $notificationManager, |
|
66 | - ITimeFactory $timeFactory, |
|
67 | - IJobList $jobList, |
|
68 | - TransferOwnershipMapper $mapper, |
|
69 | - IUserManager $userManager, |
|
70 | - IRootFolder $rootFolder) { |
|
71 | - parent::__construct($appName, $request); |
|
72 | - |
|
73 | - $this->userId = $userId; |
|
74 | - $this->notificationManager = $notificationManager; |
|
75 | - $this->timeFactory = $timeFactory; |
|
76 | - $this->jobList = $jobList; |
|
77 | - $this->mapper = $mapper; |
|
78 | - $this->userManager = $userManager; |
|
79 | - $this->rootFolder = $rootFolder; |
|
80 | - } |
|
81 | - |
|
82 | - |
|
83 | - /** |
|
84 | - * @NoAdminRequired |
|
85 | - */ |
|
86 | - public function transfer(string $recipient, string $path): DataResponse { |
|
87 | - $recipientUser = $this->userManager->get($recipient); |
|
88 | - |
|
89 | - if ($recipientUser === null) { |
|
90 | - return new DataResponse([], Http::STATUS_BAD_REQUEST); |
|
91 | - } |
|
92 | - |
|
93 | - $userRoot = $this->rootFolder->getUserFolder($this->userId); |
|
94 | - |
|
95 | - try { |
|
96 | - $node = $userRoot->get($path); |
|
97 | - } catch (\Exception $e) { |
|
98 | - return new DataResponse([], Http::STATUS_BAD_REQUEST); |
|
99 | - } |
|
100 | - |
|
101 | - if ($node->getOwner()->getUID() !== $this->userId || !$node->getStorage()->instanceOfStorage(IHomeStorage::class)) { |
|
102 | - return new DataResponse([], Http::STATUS_FORBIDDEN); |
|
103 | - } |
|
104 | - |
|
105 | - $transferOwnership = new TransferOwnershipEntity(); |
|
106 | - $transferOwnership->setSourceUser($this->userId); |
|
107 | - $transferOwnership->setTargetUser($recipient); |
|
108 | - $transferOwnership->setFileId($node->getId()); |
|
109 | - $transferOwnership->setNodeName($node->getName()); |
|
110 | - $transferOwnership = $this->mapper->insert($transferOwnership); |
|
111 | - |
|
112 | - $notification = $this->notificationManager->createNotification(); |
|
113 | - $notification->setUser($recipient) |
|
114 | - ->setApp($this->appName) |
|
115 | - ->setDateTime($this->timeFactory->getDateTime()) |
|
116 | - ->setSubject('transferownershipRequest', [ |
|
117 | - 'sourceUser' => $this->userId, |
|
118 | - 'targetUser' => $recipient, |
|
119 | - 'nodeName' => $node->getName(), |
|
120 | - ]) |
|
121 | - ->setObject('transfer', (string)$transferOwnership->getId()); |
|
122 | - |
|
123 | - $this->notificationManager->notify($notification); |
|
124 | - |
|
125 | - return new DataResponse([]); |
|
126 | - } |
|
127 | - |
|
128 | - /** |
|
129 | - * @NoAdminRequired |
|
130 | - */ |
|
131 | - public function accept(int $id): DataResponse { |
|
132 | - try { |
|
133 | - $transferOwnership = $this->mapper->getById($id); |
|
134 | - } catch (DoesNotExistException $e) { |
|
135 | - return new DataResponse([], Http::STATUS_NOT_FOUND); |
|
136 | - } |
|
137 | - |
|
138 | - if ($transferOwnership->getTargetUser() !== $this->userId) { |
|
139 | - return new DataResponse([], Http::STATUS_FORBIDDEN); |
|
140 | - } |
|
141 | - |
|
142 | - $notification = $this->notificationManager->createNotification(); |
|
143 | - $notification->setApp('files') |
|
144 | - ->setObject('transfer', (string)$id); |
|
145 | - $this->notificationManager->markProcessed($notification); |
|
146 | - |
|
147 | - $newTransferOwnership = new TransferOwnershipEntity(); |
|
148 | - $newTransferOwnership->setNodeName($transferOwnership->getNodeName()); |
|
149 | - $newTransferOwnership->setFileId($transferOwnership->getFileId()); |
|
150 | - $newTransferOwnership->setSourceUser($transferOwnership->getSourceUser()); |
|
151 | - $newTransferOwnership->setTargetUser($transferOwnership->getTargetUser()); |
|
152 | - $this->mapper->insert($newTransferOwnership); |
|
153 | - |
|
154 | - $this->jobList->add(TransferOwnership::class, [ |
|
155 | - 'id' => $newTransferOwnership->getId(), |
|
156 | - ]); |
|
157 | - |
|
158 | - return new DataResponse([], Http::STATUS_OK); |
|
159 | - } |
|
160 | - |
|
161 | - /** |
|
162 | - * @NoAdminRequired |
|
163 | - */ |
|
164 | - public function reject(int $id): DataResponse { |
|
165 | - try { |
|
166 | - $transferOwnership = $this->mapper->getById($id); |
|
167 | - } catch (DoesNotExistException $e) { |
|
168 | - return new DataResponse([], Http::STATUS_NOT_FOUND); |
|
169 | - } |
|
170 | - |
|
171 | - if ($transferOwnership->getTargetUser() !== $this->userId) { |
|
172 | - return new DataResponse([], Http::STATUS_FORBIDDEN); |
|
173 | - } |
|
174 | - |
|
175 | - $notification = $this->notificationManager->createNotification(); |
|
176 | - $notification->setApp('files') |
|
177 | - ->setObject('transfer', (string)$id); |
|
178 | - $this->notificationManager->markProcessed($notification); |
|
179 | - |
|
180 | - $notification = $this->notificationManager->createNotification(); |
|
181 | - $notification->setUser($transferOwnership->getSourceUser()) |
|
182 | - ->setApp($this->appName) |
|
183 | - ->setDateTime($this->timeFactory->getDateTime()) |
|
184 | - ->setSubject('transferownershipRequestDenied', [ |
|
185 | - 'sourceUser' => $transferOwnership->getSourceUser(), |
|
186 | - 'targetUser' => $transferOwnership->getTargetUser(), |
|
187 | - 'nodeName' => $transferOwnership->getNodeName() |
|
188 | - ]) |
|
189 | - ->setObject('transfer', (string)$transferOwnership->getId()); |
|
190 | - $this->notificationManager->notify($notification); |
|
191 | - |
|
192 | - $this->mapper->delete($transferOwnership); |
|
193 | - |
|
194 | - return new DataResponse([], Http::STATUS_OK); |
|
195 | - } |
|
47 | + /** @var string */ |
|
48 | + private $userId; |
|
49 | + /** @var NotificationManager */ |
|
50 | + private $notificationManager; |
|
51 | + /** @var ITimeFactory */ |
|
52 | + private $timeFactory; |
|
53 | + /** @var IJobList */ |
|
54 | + private $jobList; |
|
55 | + /** @var TransferOwnershipMapper */ |
|
56 | + private $mapper; |
|
57 | + /** @var IUserManager */ |
|
58 | + private $userManager; |
|
59 | + /** @var IRootFolder */ |
|
60 | + private $rootFolder; |
|
61 | + |
|
62 | + public function __construct(string $appName, |
|
63 | + IRequest $request, |
|
64 | + string $userId, |
|
65 | + NotificationManager $notificationManager, |
|
66 | + ITimeFactory $timeFactory, |
|
67 | + IJobList $jobList, |
|
68 | + TransferOwnershipMapper $mapper, |
|
69 | + IUserManager $userManager, |
|
70 | + IRootFolder $rootFolder) { |
|
71 | + parent::__construct($appName, $request); |
|
72 | + |
|
73 | + $this->userId = $userId; |
|
74 | + $this->notificationManager = $notificationManager; |
|
75 | + $this->timeFactory = $timeFactory; |
|
76 | + $this->jobList = $jobList; |
|
77 | + $this->mapper = $mapper; |
|
78 | + $this->userManager = $userManager; |
|
79 | + $this->rootFolder = $rootFolder; |
|
80 | + } |
|
81 | + |
|
82 | + |
|
83 | + /** |
|
84 | + * @NoAdminRequired |
|
85 | + */ |
|
86 | + public function transfer(string $recipient, string $path): DataResponse { |
|
87 | + $recipientUser = $this->userManager->get($recipient); |
|
88 | + |
|
89 | + if ($recipientUser === null) { |
|
90 | + return new DataResponse([], Http::STATUS_BAD_REQUEST); |
|
91 | + } |
|
92 | + |
|
93 | + $userRoot = $this->rootFolder->getUserFolder($this->userId); |
|
94 | + |
|
95 | + try { |
|
96 | + $node = $userRoot->get($path); |
|
97 | + } catch (\Exception $e) { |
|
98 | + return new DataResponse([], Http::STATUS_BAD_REQUEST); |
|
99 | + } |
|
100 | + |
|
101 | + if ($node->getOwner()->getUID() !== $this->userId || !$node->getStorage()->instanceOfStorage(IHomeStorage::class)) { |
|
102 | + return new DataResponse([], Http::STATUS_FORBIDDEN); |
|
103 | + } |
|
104 | + |
|
105 | + $transferOwnership = new TransferOwnershipEntity(); |
|
106 | + $transferOwnership->setSourceUser($this->userId); |
|
107 | + $transferOwnership->setTargetUser($recipient); |
|
108 | + $transferOwnership->setFileId($node->getId()); |
|
109 | + $transferOwnership->setNodeName($node->getName()); |
|
110 | + $transferOwnership = $this->mapper->insert($transferOwnership); |
|
111 | + |
|
112 | + $notification = $this->notificationManager->createNotification(); |
|
113 | + $notification->setUser($recipient) |
|
114 | + ->setApp($this->appName) |
|
115 | + ->setDateTime($this->timeFactory->getDateTime()) |
|
116 | + ->setSubject('transferownershipRequest', [ |
|
117 | + 'sourceUser' => $this->userId, |
|
118 | + 'targetUser' => $recipient, |
|
119 | + 'nodeName' => $node->getName(), |
|
120 | + ]) |
|
121 | + ->setObject('transfer', (string)$transferOwnership->getId()); |
|
122 | + |
|
123 | + $this->notificationManager->notify($notification); |
|
124 | + |
|
125 | + return new DataResponse([]); |
|
126 | + } |
|
127 | + |
|
128 | + /** |
|
129 | + * @NoAdminRequired |
|
130 | + */ |
|
131 | + public function accept(int $id): DataResponse { |
|
132 | + try { |
|
133 | + $transferOwnership = $this->mapper->getById($id); |
|
134 | + } catch (DoesNotExistException $e) { |
|
135 | + return new DataResponse([], Http::STATUS_NOT_FOUND); |
|
136 | + } |
|
137 | + |
|
138 | + if ($transferOwnership->getTargetUser() !== $this->userId) { |
|
139 | + return new DataResponse([], Http::STATUS_FORBIDDEN); |
|
140 | + } |
|
141 | + |
|
142 | + $notification = $this->notificationManager->createNotification(); |
|
143 | + $notification->setApp('files') |
|
144 | + ->setObject('transfer', (string)$id); |
|
145 | + $this->notificationManager->markProcessed($notification); |
|
146 | + |
|
147 | + $newTransferOwnership = new TransferOwnershipEntity(); |
|
148 | + $newTransferOwnership->setNodeName($transferOwnership->getNodeName()); |
|
149 | + $newTransferOwnership->setFileId($transferOwnership->getFileId()); |
|
150 | + $newTransferOwnership->setSourceUser($transferOwnership->getSourceUser()); |
|
151 | + $newTransferOwnership->setTargetUser($transferOwnership->getTargetUser()); |
|
152 | + $this->mapper->insert($newTransferOwnership); |
|
153 | + |
|
154 | + $this->jobList->add(TransferOwnership::class, [ |
|
155 | + 'id' => $newTransferOwnership->getId(), |
|
156 | + ]); |
|
157 | + |
|
158 | + return new DataResponse([], Http::STATUS_OK); |
|
159 | + } |
|
160 | + |
|
161 | + /** |
|
162 | + * @NoAdminRequired |
|
163 | + */ |
|
164 | + public function reject(int $id): DataResponse { |
|
165 | + try { |
|
166 | + $transferOwnership = $this->mapper->getById($id); |
|
167 | + } catch (DoesNotExistException $e) { |
|
168 | + return new DataResponse([], Http::STATUS_NOT_FOUND); |
|
169 | + } |
|
170 | + |
|
171 | + if ($transferOwnership->getTargetUser() !== $this->userId) { |
|
172 | + return new DataResponse([], Http::STATUS_FORBIDDEN); |
|
173 | + } |
|
174 | + |
|
175 | + $notification = $this->notificationManager->createNotification(); |
|
176 | + $notification->setApp('files') |
|
177 | + ->setObject('transfer', (string)$id); |
|
178 | + $this->notificationManager->markProcessed($notification); |
|
179 | + |
|
180 | + $notification = $this->notificationManager->createNotification(); |
|
181 | + $notification->setUser($transferOwnership->getSourceUser()) |
|
182 | + ->setApp($this->appName) |
|
183 | + ->setDateTime($this->timeFactory->getDateTime()) |
|
184 | + ->setSubject('transferownershipRequestDenied', [ |
|
185 | + 'sourceUser' => $transferOwnership->getSourceUser(), |
|
186 | + 'targetUser' => $transferOwnership->getTargetUser(), |
|
187 | + 'nodeName' => $transferOwnership->getNodeName() |
|
188 | + ]) |
|
189 | + ->setObject('transfer', (string)$transferOwnership->getId()); |
|
190 | + $this->notificationManager->notify($notification); |
|
191 | + |
|
192 | + $this->mapper->delete($transferOwnership); |
|
193 | + |
|
194 | + return new DataResponse([], Http::STATUS_OK); |
|
195 | + } |
|
196 | 196 | } |
@@ -212,7 +212,7 @@ |
||
212 | 212 | return $this->file->fopen('w'); |
213 | 213 | } else { |
214 | 214 | $source = fopen('php://temp', 'w+'); |
215 | - return CallbackWrapper::wrap($source, null, null, null, null, function () use ($source) { |
|
215 | + return CallbackWrapper::wrap($source, null, null, null, null, function() use ($source) { |
|
216 | 216 | rewind($source); |
217 | 217 | $this->putContent($source); |
218 | 218 | }); |
@@ -34,196 +34,196 @@ |
||
34 | 34 | use OCP\Files\SimpleFS\ISimpleFile; |
35 | 35 | |
36 | 36 | class NewSimpleFile implements ISimpleFile { |
37 | - private Folder $parentFolder; |
|
38 | - private string $name; |
|
39 | - private ?File $file = null; |
|
40 | - |
|
41 | - /** |
|
42 | - * File constructor. |
|
43 | - */ |
|
44 | - public function __construct(Folder $parentFolder, string $name) { |
|
45 | - $this->parentFolder = $parentFolder; |
|
46 | - $this->name = $name; |
|
47 | - } |
|
48 | - |
|
49 | - /** |
|
50 | - * Get the name |
|
51 | - */ |
|
52 | - public function getName(): string { |
|
53 | - return $this->name; |
|
54 | - } |
|
55 | - |
|
56 | - /** |
|
57 | - * Get the size in bytes |
|
58 | - */ |
|
59 | - public function getSize(): int { |
|
60 | - if ($this->file) { |
|
61 | - return $this->file->getSize(); |
|
62 | - } else { |
|
63 | - return 0; |
|
64 | - } |
|
65 | - } |
|
66 | - |
|
67 | - /** |
|
68 | - * Get the ETag |
|
69 | - */ |
|
70 | - public function getETag(): string { |
|
71 | - if ($this->file) { |
|
72 | - return $this->file->getEtag(); |
|
73 | - } else { |
|
74 | - return ''; |
|
75 | - } |
|
76 | - } |
|
77 | - |
|
78 | - /** |
|
79 | - * Get the last modification time |
|
80 | - */ |
|
81 | - public function getMTime(): int { |
|
82 | - if ($this->file) { |
|
83 | - return $this->file->getMTime(); |
|
84 | - } else { |
|
85 | - return time(); |
|
86 | - } |
|
87 | - } |
|
88 | - |
|
89 | - /** |
|
90 | - * Get the content |
|
91 | - * |
|
92 | - * @throws NotFoundException |
|
93 | - * @throws NotPermittedException |
|
94 | - */ |
|
95 | - public function getContent(): string { |
|
96 | - if ($this->file) { |
|
97 | - $result = $this->file->getContent(); |
|
98 | - |
|
99 | - if ($result === false) { |
|
100 | - $this->checkFile(); |
|
101 | - } |
|
102 | - |
|
103 | - return $result; |
|
104 | - } else { |
|
105 | - return ''; |
|
106 | - } |
|
107 | - } |
|
108 | - |
|
109 | - /** |
|
110 | - * Overwrite the file |
|
111 | - * |
|
112 | - * @param string|resource $data |
|
113 | - * @throws NotPermittedException |
|
114 | - * @throws NotFoundException |
|
115 | - */ |
|
116 | - public function putContent($data): void { |
|
117 | - try { |
|
118 | - if ($this->file) { |
|
119 | - $this->file->putContent($data); |
|
120 | - } else { |
|
121 | - $this->file = $this->parentFolder->newFile($this->name, $data); |
|
122 | - } |
|
123 | - } catch (NotFoundException $e) { |
|
124 | - $this->checkFile(); |
|
125 | - } |
|
126 | - } |
|
127 | - |
|
128 | - /** |
|
129 | - * Sometimes there are some issues with the AppData. Most of them are from |
|
130 | - * user error. But we should handle them gracefully anyway. |
|
131 | - * |
|
132 | - * If for some reason the current file can't be found. We remove it. |
|
133 | - * Then traverse up and check all folders if they exists. This so that the |
|
134 | - * next request will have a valid appdata structure again. |
|
135 | - * |
|
136 | - * @throws NotFoundException |
|
137 | - */ |
|
138 | - private function checkFile(): void { |
|
139 | - if (!$this->file) { |
|
140 | - throw new NotFoundException('File not set'); |
|
141 | - } |
|
142 | - |
|
143 | - $cur = $this->file; |
|
144 | - |
|
145 | - while ($cur->stat() === false) { |
|
146 | - $parent = $cur->getParent(); |
|
147 | - try { |
|
148 | - $cur->delete(); |
|
149 | - } catch (NotFoundException $e) { |
|
150 | - // Just continue then |
|
151 | - } |
|
152 | - $cur = $parent; |
|
153 | - } |
|
154 | - |
|
155 | - if ($cur !== $this->file) { |
|
156 | - throw new NotFoundException('File does not exist'); |
|
157 | - } |
|
158 | - } |
|
159 | - |
|
160 | - |
|
161 | - /** |
|
162 | - * Delete the file |
|
163 | - * |
|
164 | - * @throws NotPermittedException |
|
165 | - */ |
|
166 | - public function delete(): void { |
|
167 | - if ($this->file) { |
|
168 | - $this->file->delete(); |
|
169 | - } |
|
170 | - } |
|
171 | - |
|
172 | - /** |
|
173 | - * Get the MimeType |
|
174 | - * |
|
175 | - * @return string |
|
176 | - */ |
|
177 | - public function getMimeType(): string { |
|
178 | - if ($this->file) { |
|
179 | - return $this->file->getMimeType(); |
|
180 | - } else { |
|
181 | - return 'text/plain'; |
|
182 | - } |
|
183 | - } |
|
184 | - |
|
185 | - /** |
|
186 | - * {@inheritDoc} |
|
187 | - */ |
|
188 | - public function getExtension(): string { |
|
189 | - if ($this->file) { |
|
190 | - return $this->file->getExtension(); |
|
191 | - } else { |
|
192 | - return \pathinfo($this->name, PATHINFO_EXTENSION); |
|
193 | - } |
|
194 | - } |
|
195 | - |
|
196 | - /** |
|
197 | - * Open the file as stream for reading, resulting resource can be operated as stream like the result from php's own fopen |
|
198 | - * |
|
199 | - * @return resource |
|
200 | - * @throws \OCP\Files\NotPermittedException |
|
201 | - * @since 14.0.0 |
|
202 | - */ |
|
203 | - public function read() { |
|
204 | - if ($this->file) { |
|
205 | - return $this->file->fopen('r'); |
|
206 | - } else { |
|
207 | - return fopen('php://temp', 'r'); |
|
208 | - } |
|
209 | - } |
|
210 | - |
|
211 | - /** |
|
212 | - * Open the file as stream for writing, resulting resource can be operated as stream like the result from php's own fopen |
|
213 | - * |
|
214 | - * @return resource|bool |
|
215 | - * @throws \OCP\Files\NotPermittedException |
|
216 | - * @since 14.0.0 |
|
217 | - */ |
|
218 | - public function write() { |
|
219 | - if ($this->file) { |
|
220 | - return $this->file->fopen('w'); |
|
221 | - } else { |
|
222 | - $source = fopen('php://temp', 'w+'); |
|
223 | - return CallbackWrapper::wrap($source, null, null, null, null, function () use ($source) { |
|
224 | - rewind($source); |
|
225 | - $this->putContent($source); |
|
226 | - }); |
|
227 | - } |
|
228 | - } |
|
37 | + private Folder $parentFolder; |
|
38 | + private string $name; |
|
39 | + private ?File $file = null; |
|
40 | + |
|
41 | + /** |
|
42 | + * File constructor. |
|
43 | + */ |
|
44 | + public function __construct(Folder $parentFolder, string $name) { |
|
45 | + $this->parentFolder = $parentFolder; |
|
46 | + $this->name = $name; |
|
47 | + } |
|
48 | + |
|
49 | + /** |
|
50 | + * Get the name |
|
51 | + */ |
|
52 | + public function getName(): string { |
|
53 | + return $this->name; |
|
54 | + } |
|
55 | + |
|
56 | + /** |
|
57 | + * Get the size in bytes |
|
58 | + */ |
|
59 | + public function getSize(): int { |
|
60 | + if ($this->file) { |
|
61 | + return $this->file->getSize(); |
|
62 | + } else { |
|
63 | + return 0; |
|
64 | + } |
|
65 | + } |
|
66 | + |
|
67 | + /** |
|
68 | + * Get the ETag |
|
69 | + */ |
|
70 | + public function getETag(): string { |
|
71 | + if ($this->file) { |
|
72 | + return $this->file->getEtag(); |
|
73 | + } else { |
|
74 | + return ''; |
|
75 | + } |
|
76 | + } |
|
77 | + |
|
78 | + /** |
|
79 | + * Get the last modification time |
|
80 | + */ |
|
81 | + public function getMTime(): int { |
|
82 | + if ($this->file) { |
|
83 | + return $this->file->getMTime(); |
|
84 | + } else { |
|
85 | + return time(); |
|
86 | + } |
|
87 | + } |
|
88 | + |
|
89 | + /** |
|
90 | + * Get the content |
|
91 | + * |
|
92 | + * @throws NotFoundException |
|
93 | + * @throws NotPermittedException |
|
94 | + */ |
|
95 | + public function getContent(): string { |
|
96 | + if ($this->file) { |
|
97 | + $result = $this->file->getContent(); |
|
98 | + |
|
99 | + if ($result === false) { |
|
100 | + $this->checkFile(); |
|
101 | + } |
|
102 | + |
|
103 | + return $result; |
|
104 | + } else { |
|
105 | + return ''; |
|
106 | + } |
|
107 | + } |
|
108 | + |
|
109 | + /** |
|
110 | + * Overwrite the file |
|
111 | + * |
|
112 | + * @param string|resource $data |
|
113 | + * @throws NotPermittedException |
|
114 | + * @throws NotFoundException |
|
115 | + */ |
|
116 | + public function putContent($data): void { |
|
117 | + try { |
|
118 | + if ($this->file) { |
|
119 | + $this->file->putContent($data); |
|
120 | + } else { |
|
121 | + $this->file = $this->parentFolder->newFile($this->name, $data); |
|
122 | + } |
|
123 | + } catch (NotFoundException $e) { |
|
124 | + $this->checkFile(); |
|
125 | + } |
|
126 | + } |
|
127 | + |
|
128 | + /** |
|
129 | + * Sometimes there are some issues with the AppData. Most of them are from |
|
130 | + * user error. But we should handle them gracefully anyway. |
|
131 | + * |
|
132 | + * If for some reason the current file can't be found. We remove it. |
|
133 | + * Then traverse up and check all folders if they exists. This so that the |
|
134 | + * next request will have a valid appdata structure again. |
|
135 | + * |
|
136 | + * @throws NotFoundException |
|
137 | + */ |
|
138 | + private function checkFile(): void { |
|
139 | + if (!$this->file) { |
|
140 | + throw new NotFoundException('File not set'); |
|
141 | + } |
|
142 | + |
|
143 | + $cur = $this->file; |
|
144 | + |
|
145 | + while ($cur->stat() === false) { |
|
146 | + $parent = $cur->getParent(); |
|
147 | + try { |
|
148 | + $cur->delete(); |
|
149 | + } catch (NotFoundException $e) { |
|
150 | + // Just continue then |
|
151 | + } |
|
152 | + $cur = $parent; |
|
153 | + } |
|
154 | + |
|
155 | + if ($cur !== $this->file) { |
|
156 | + throw new NotFoundException('File does not exist'); |
|
157 | + } |
|
158 | + } |
|
159 | + |
|
160 | + |
|
161 | + /** |
|
162 | + * Delete the file |
|
163 | + * |
|
164 | + * @throws NotPermittedException |
|
165 | + */ |
|
166 | + public function delete(): void { |
|
167 | + if ($this->file) { |
|
168 | + $this->file->delete(); |
|
169 | + } |
|
170 | + } |
|
171 | + |
|
172 | + /** |
|
173 | + * Get the MimeType |
|
174 | + * |
|
175 | + * @return string |
|
176 | + */ |
|
177 | + public function getMimeType(): string { |
|
178 | + if ($this->file) { |
|
179 | + return $this->file->getMimeType(); |
|
180 | + } else { |
|
181 | + return 'text/plain'; |
|
182 | + } |
|
183 | + } |
|
184 | + |
|
185 | + /** |
|
186 | + * {@inheritDoc} |
|
187 | + */ |
|
188 | + public function getExtension(): string { |
|
189 | + if ($this->file) { |
|
190 | + return $this->file->getExtension(); |
|
191 | + } else { |
|
192 | + return \pathinfo($this->name, PATHINFO_EXTENSION); |
|
193 | + } |
|
194 | + } |
|
195 | + |
|
196 | + /** |
|
197 | + * Open the file as stream for reading, resulting resource can be operated as stream like the result from php's own fopen |
|
198 | + * |
|
199 | + * @return resource |
|
200 | + * @throws \OCP\Files\NotPermittedException |
|
201 | + * @since 14.0.0 |
|
202 | + */ |
|
203 | + public function read() { |
|
204 | + if ($this->file) { |
|
205 | + return $this->file->fopen('r'); |
|
206 | + } else { |
|
207 | + return fopen('php://temp', 'r'); |
|
208 | + } |
|
209 | + } |
|
210 | + |
|
211 | + /** |
|
212 | + * Open the file as stream for writing, resulting resource can be operated as stream like the result from php's own fopen |
|
213 | + * |
|
214 | + * @return resource|bool |
|
215 | + * @throws \OCP\Files\NotPermittedException |
|
216 | + * @since 14.0.0 |
|
217 | + */ |
|
218 | + public function write() { |
|
219 | + if ($this->file) { |
|
220 | + return $this->file->fopen('w'); |
|
221 | + } else { |
|
222 | + $source = fopen('php://temp', 'w+'); |
|
223 | + return CallbackWrapper::wrap($source, null, null, null, null, function () use ($source) { |
|
224 | + rewind($source); |
|
225 | + $this->putContent($source); |
|
226 | + }); |
|
227 | + } |
|
228 | + } |
|
229 | 229 | } |
@@ -27,147 +27,147 @@ |
||
27 | 27 | use OCP\Files\NotFoundException; |
28 | 28 | |
29 | 29 | class NonExistingFolder extends Folder { |
30 | - /** |
|
31 | - * @param string $newPath |
|
32 | - * @throws \OCP\Files\NotFoundException |
|
33 | - */ |
|
34 | - public function rename($newPath) { |
|
35 | - throw new NotFoundException(); |
|
36 | - } |
|
37 | - |
|
38 | - public function delete() { |
|
39 | - throw new NotFoundException(); |
|
40 | - } |
|
41 | - |
|
42 | - public function copy($newPath) { |
|
43 | - throw new NotFoundException(); |
|
44 | - } |
|
45 | - |
|
46 | - public function touch($mtime = null) { |
|
47 | - throw new NotFoundException(); |
|
48 | - } |
|
49 | - |
|
50 | - public function getId() { |
|
51 | - if ($this->fileInfo) { |
|
52 | - return parent::getId(); |
|
53 | - } else { |
|
54 | - throw new NotFoundException(); |
|
55 | - } |
|
56 | - } |
|
57 | - |
|
58 | - public function stat() { |
|
59 | - throw new NotFoundException(); |
|
60 | - } |
|
61 | - |
|
62 | - public function getMTime() { |
|
63 | - if ($this->fileInfo) { |
|
64 | - return parent::getMTime(); |
|
65 | - } else { |
|
66 | - throw new NotFoundException(); |
|
67 | - } |
|
68 | - } |
|
69 | - |
|
70 | - public function getSize($includeMounts = true) { |
|
71 | - if ($this->fileInfo) { |
|
72 | - return parent::getSize($includeMounts); |
|
73 | - } else { |
|
74 | - throw new NotFoundException(); |
|
75 | - } |
|
76 | - } |
|
77 | - |
|
78 | - public function getEtag() { |
|
79 | - if ($this->fileInfo) { |
|
80 | - return parent::getEtag(); |
|
81 | - } else { |
|
82 | - throw new NotFoundException(); |
|
83 | - } |
|
84 | - } |
|
85 | - |
|
86 | - public function getPermissions() { |
|
87 | - if ($this->fileInfo) { |
|
88 | - return parent::getPermissions(); |
|
89 | - } else { |
|
90 | - throw new NotFoundException(); |
|
91 | - } |
|
92 | - } |
|
93 | - |
|
94 | - public function isReadable() { |
|
95 | - if ($this->fileInfo) { |
|
96 | - return parent::isReadable(); |
|
97 | - } else { |
|
98 | - throw new NotFoundException(); |
|
99 | - } |
|
100 | - } |
|
101 | - |
|
102 | - public function isUpdateable() { |
|
103 | - if ($this->fileInfo) { |
|
104 | - return parent::isUpdateable(); |
|
105 | - } else { |
|
106 | - throw new NotFoundException(); |
|
107 | - } |
|
108 | - } |
|
109 | - |
|
110 | - public function isDeletable() { |
|
111 | - if ($this->fileInfo) { |
|
112 | - return parent::isDeletable(); |
|
113 | - } else { |
|
114 | - throw new NotFoundException(); |
|
115 | - } |
|
116 | - } |
|
117 | - |
|
118 | - public function isShareable() { |
|
119 | - if ($this->fileInfo) { |
|
120 | - return parent::isShareable(); |
|
121 | - } else { |
|
122 | - throw new NotFoundException(); |
|
123 | - } |
|
124 | - } |
|
125 | - |
|
126 | - public function get($path) { |
|
127 | - throw new NotFoundException(); |
|
128 | - } |
|
129 | - |
|
130 | - public function getDirectoryListing() { |
|
131 | - throw new NotFoundException(); |
|
132 | - } |
|
133 | - |
|
134 | - public function nodeExists($path) { |
|
135 | - return false; |
|
136 | - } |
|
137 | - |
|
138 | - public function newFolder($path) { |
|
139 | - throw new NotFoundException(); |
|
140 | - } |
|
141 | - |
|
142 | - public function newFile($path, $content = null) { |
|
143 | - throw new NotFoundException(); |
|
144 | - } |
|
145 | - |
|
146 | - public function search($pattern) { |
|
147 | - throw new NotFoundException(); |
|
148 | - } |
|
149 | - |
|
150 | - public function searchByMime($mime) { |
|
151 | - throw new NotFoundException(); |
|
152 | - } |
|
153 | - |
|
154 | - public function searchByTag($tag, $userId) { |
|
155 | - throw new NotFoundException(); |
|
156 | - } |
|
157 | - |
|
158 | - public function getById($id) { |
|
159 | - throw new NotFoundException(); |
|
160 | - } |
|
161 | - |
|
162 | - public function getFreeSpace() { |
|
163 | - throw new NotFoundException(); |
|
164 | - } |
|
165 | - |
|
166 | - public function isCreatable() { |
|
167 | - if ($this->fileInfo) { |
|
168 | - return parent::isCreatable(); |
|
169 | - } else { |
|
170 | - throw new NotFoundException(); |
|
171 | - } |
|
172 | - } |
|
30 | + /** |
|
31 | + * @param string $newPath |
|
32 | + * @throws \OCP\Files\NotFoundException |
|
33 | + */ |
|
34 | + public function rename($newPath) { |
|
35 | + throw new NotFoundException(); |
|
36 | + } |
|
37 | + |
|
38 | + public function delete() { |
|
39 | + throw new NotFoundException(); |
|
40 | + } |
|
41 | + |
|
42 | + public function copy($newPath) { |
|
43 | + throw new NotFoundException(); |
|
44 | + } |
|
45 | + |
|
46 | + public function touch($mtime = null) { |
|
47 | + throw new NotFoundException(); |
|
48 | + } |
|
49 | + |
|
50 | + public function getId() { |
|
51 | + if ($this->fileInfo) { |
|
52 | + return parent::getId(); |
|
53 | + } else { |
|
54 | + throw new NotFoundException(); |
|
55 | + } |
|
56 | + } |
|
57 | + |
|
58 | + public function stat() { |
|
59 | + throw new NotFoundException(); |
|
60 | + } |
|
61 | + |
|
62 | + public function getMTime() { |
|
63 | + if ($this->fileInfo) { |
|
64 | + return parent::getMTime(); |
|
65 | + } else { |
|
66 | + throw new NotFoundException(); |
|
67 | + } |
|
68 | + } |
|
69 | + |
|
70 | + public function getSize($includeMounts = true) { |
|
71 | + if ($this->fileInfo) { |
|
72 | + return parent::getSize($includeMounts); |
|
73 | + } else { |
|
74 | + throw new NotFoundException(); |
|
75 | + } |
|
76 | + } |
|
77 | + |
|
78 | + public function getEtag() { |
|
79 | + if ($this->fileInfo) { |
|
80 | + return parent::getEtag(); |
|
81 | + } else { |
|
82 | + throw new NotFoundException(); |
|
83 | + } |
|
84 | + } |
|
85 | + |
|
86 | + public function getPermissions() { |
|
87 | + if ($this->fileInfo) { |
|
88 | + return parent::getPermissions(); |
|
89 | + } else { |
|
90 | + throw new NotFoundException(); |
|
91 | + } |
|
92 | + } |
|
93 | + |
|
94 | + public function isReadable() { |
|
95 | + if ($this->fileInfo) { |
|
96 | + return parent::isReadable(); |
|
97 | + } else { |
|
98 | + throw new NotFoundException(); |
|
99 | + } |
|
100 | + } |
|
101 | + |
|
102 | + public function isUpdateable() { |
|
103 | + if ($this->fileInfo) { |
|
104 | + return parent::isUpdateable(); |
|
105 | + } else { |
|
106 | + throw new NotFoundException(); |
|
107 | + } |
|
108 | + } |
|
109 | + |
|
110 | + public function isDeletable() { |
|
111 | + if ($this->fileInfo) { |
|
112 | + return parent::isDeletable(); |
|
113 | + } else { |
|
114 | + throw new NotFoundException(); |
|
115 | + } |
|
116 | + } |
|
117 | + |
|
118 | + public function isShareable() { |
|
119 | + if ($this->fileInfo) { |
|
120 | + return parent::isShareable(); |
|
121 | + } else { |
|
122 | + throw new NotFoundException(); |
|
123 | + } |
|
124 | + } |
|
125 | + |
|
126 | + public function get($path) { |
|
127 | + throw new NotFoundException(); |
|
128 | + } |
|
129 | + |
|
130 | + public function getDirectoryListing() { |
|
131 | + throw new NotFoundException(); |
|
132 | + } |
|
133 | + |
|
134 | + public function nodeExists($path) { |
|
135 | + return false; |
|
136 | + } |
|
137 | + |
|
138 | + public function newFolder($path) { |
|
139 | + throw new NotFoundException(); |
|
140 | + } |
|
141 | + |
|
142 | + public function newFile($path, $content = null) { |
|
143 | + throw new NotFoundException(); |
|
144 | + } |
|
145 | + |
|
146 | + public function search($pattern) { |
|
147 | + throw new NotFoundException(); |
|
148 | + } |
|
149 | + |
|
150 | + public function searchByMime($mime) { |
|
151 | + throw new NotFoundException(); |
|
152 | + } |
|
153 | + |
|
154 | + public function searchByTag($tag, $userId) { |
|
155 | + throw new NotFoundException(); |
|
156 | + } |
|
157 | + |
|
158 | + public function getById($id) { |
|
159 | + throw new NotFoundException(); |
|
160 | + } |
|
161 | + |
|
162 | + public function getFreeSpace() { |
|
163 | + throw new NotFoundException(); |
|
164 | + } |
|
165 | + |
|
166 | + public function isCreatable() { |
|
167 | + if ($this->fileInfo) { |
|
168 | + return parent::isCreatable(); |
|
169 | + } else { |
|
170 | + throw new NotFoundException(); |
|
171 | + } |
|
172 | + } |
|
173 | 173 | } |
@@ -37,64 +37,64 @@ |
||
37 | 37 | * @since 15.0.0 |
38 | 38 | */ |
39 | 39 | interface IVersionBackend { |
40 | - /** |
|
41 | - * Whether or not this version backend should be used for a storage |
|
42 | - * |
|
43 | - * If false is returned then the next applicable backend will be used |
|
44 | - * |
|
45 | - * @param IStorage $storage |
|
46 | - * @return bool |
|
47 | - * @since 17.0.0 |
|
48 | - */ |
|
49 | - public function useBackendForStorage(IStorage $storage): bool; |
|
40 | + /** |
|
41 | + * Whether or not this version backend should be used for a storage |
|
42 | + * |
|
43 | + * If false is returned then the next applicable backend will be used |
|
44 | + * |
|
45 | + * @param IStorage $storage |
|
46 | + * @return bool |
|
47 | + * @since 17.0.0 |
|
48 | + */ |
|
49 | + public function useBackendForStorage(IStorage $storage): bool; |
|
50 | 50 | |
51 | - /** |
|
52 | - * Get all versions for a file |
|
53 | - * |
|
54 | - * @param IUser $user |
|
55 | - * @param FileInfo $file |
|
56 | - * @return IVersion[] |
|
57 | - * @since 15.0.0 |
|
58 | - */ |
|
59 | - public function getVersionsForFile(IUser $user, FileInfo $file): array; |
|
51 | + /** |
|
52 | + * Get all versions for a file |
|
53 | + * |
|
54 | + * @param IUser $user |
|
55 | + * @param FileInfo $file |
|
56 | + * @return IVersion[] |
|
57 | + * @since 15.0.0 |
|
58 | + */ |
|
59 | + public function getVersionsForFile(IUser $user, FileInfo $file): array; |
|
60 | 60 | |
61 | - /** |
|
62 | - * Create a new version for a file |
|
63 | - * |
|
64 | - * @param IUser $user |
|
65 | - * @param FileInfo $file |
|
66 | - * @since 15.0.0 |
|
67 | - */ |
|
68 | - public function createVersion(IUser $user, FileInfo $file); |
|
61 | + /** |
|
62 | + * Create a new version for a file |
|
63 | + * |
|
64 | + * @param IUser $user |
|
65 | + * @param FileInfo $file |
|
66 | + * @since 15.0.0 |
|
67 | + */ |
|
68 | + public function createVersion(IUser $user, FileInfo $file); |
|
69 | 69 | |
70 | - /** |
|
71 | - * Restore this version |
|
72 | - * |
|
73 | - * @param IVersion $version |
|
74 | - * @since 15.0.0 |
|
75 | - */ |
|
76 | - public function rollback(IVersion $version); |
|
70 | + /** |
|
71 | + * Restore this version |
|
72 | + * |
|
73 | + * @param IVersion $version |
|
74 | + * @since 15.0.0 |
|
75 | + */ |
|
76 | + public function rollback(IVersion $version); |
|
77 | 77 | |
78 | - /** |
|
79 | - * Open the file for reading |
|
80 | - * |
|
81 | - * @param IVersion $version |
|
82 | - * @return resource |
|
83 | - * @throws NotFoundException |
|
84 | - * @since 15.0.0 |
|
85 | - */ |
|
86 | - public function read(IVersion $version); |
|
78 | + /** |
|
79 | + * Open the file for reading |
|
80 | + * |
|
81 | + * @param IVersion $version |
|
82 | + * @return resource |
|
83 | + * @throws NotFoundException |
|
84 | + * @since 15.0.0 |
|
85 | + */ |
|
86 | + public function read(IVersion $version); |
|
87 | 87 | |
88 | - /** |
|
89 | - * Get the preview for a specific version of a file |
|
90 | - * |
|
91 | - * @param IUser $user |
|
92 | - * @param FileInfo $sourceFile |
|
93 | - * @param int|string $revision |
|
94 | - * |
|
95 | - * @return File |
|
96 | - * |
|
97 | - * @since 15.0.0 |
|
98 | - */ |
|
99 | - public function getVersionFile(IUser $user, FileInfo $sourceFile, $revision): File; |
|
88 | + /** |
|
89 | + * Get the preview for a specific version of a file |
|
90 | + * |
|
91 | + * @param IUser $user |
|
92 | + * @param FileInfo $sourceFile |
|
93 | + * @param int|string $revision |
|
94 | + * |
|
95 | + * @return File |
|
96 | + * |
|
97 | + * @since 15.0.0 |
|
98 | + */ |
|
99 | + public function getVersionFile(IUser $user, FileInfo $sourceFile, $revision): File; |
|
100 | 100 | } |
@@ -135,15 +135,15 @@ |
||
135 | 135 | } |
136 | 136 | |
137 | 137 | if ( |
138 | - $this->testUrl('https://' . $remote . '/ocs-provider/') || |
|
139 | - $this->testUrl('https://' . $remote . '/ocs-provider/index.php') || |
|
140 | - $this->testUrl('https://' . $remote . '/status.php', true) |
|
138 | + $this->testUrl('https://'.$remote.'/ocs-provider/') || |
|
139 | + $this->testUrl('https://'.$remote.'/ocs-provider/index.php') || |
|
140 | + $this->testUrl('https://'.$remote.'/status.php', true) |
|
141 | 141 | ) { |
142 | 142 | return new DataResponse('https'); |
143 | 143 | } elseif ( |
144 | - $this->testUrl('http://' . $remote . '/ocs-provider/') || |
|
145 | - $this->testUrl('http://' . $remote . '/ocs-provider/index.php') || |
|
146 | - $this->testUrl('http://' . $remote . '/status.php', true) |
|
144 | + $this->testUrl('http://'.$remote.'/ocs-provider/') || |
|
145 | + $this->testUrl('http://'.$remote.'/ocs-provider/index.php') || |
|
146 | + $this->testUrl('http://'.$remote.'/status.php', true) |
|
147 | 147 | ) { |
148 | 148 | return new DataResponse('http'); |
149 | 149 | } else { |
@@ -40,115 +40,115 @@ |
||
40 | 40 | */ |
41 | 41 | class ExternalSharesController extends Controller { |
42 | 42 | |
43 | - /** @var \OCA\Files_Sharing\External\Manager */ |
|
44 | - private $externalManager; |
|
45 | - /** @var IClientService */ |
|
46 | - private $clientService; |
|
43 | + /** @var \OCA\Files_Sharing\External\Manager */ |
|
44 | + private $externalManager; |
|
45 | + /** @var IClientService */ |
|
46 | + private $clientService; |
|
47 | 47 | |
48 | - /** |
|
49 | - * @param string $appName |
|
50 | - * @param IRequest $request |
|
51 | - * @param \OCA\Files_Sharing\External\Manager $externalManager |
|
52 | - * @param IClientService $clientService |
|
53 | - */ |
|
54 | - public function __construct($appName, |
|
55 | - IRequest $request, |
|
56 | - \OCA\Files_Sharing\External\Manager $externalManager, |
|
57 | - IClientService $clientService) { |
|
58 | - parent::__construct($appName, $request); |
|
59 | - $this->externalManager = $externalManager; |
|
60 | - $this->clientService = $clientService; |
|
61 | - } |
|
48 | + /** |
|
49 | + * @param string $appName |
|
50 | + * @param IRequest $request |
|
51 | + * @param \OCA\Files_Sharing\External\Manager $externalManager |
|
52 | + * @param IClientService $clientService |
|
53 | + */ |
|
54 | + public function __construct($appName, |
|
55 | + IRequest $request, |
|
56 | + \OCA\Files_Sharing\External\Manager $externalManager, |
|
57 | + IClientService $clientService) { |
|
58 | + parent::__construct($appName, $request); |
|
59 | + $this->externalManager = $externalManager; |
|
60 | + $this->clientService = $clientService; |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * @NoAdminRequired |
|
65 | - * @NoOutgoingFederatedSharingRequired |
|
66 | - * |
|
67 | - * @return JSONResponse |
|
68 | - */ |
|
69 | - public function index() { |
|
70 | - return new JSONResponse($this->externalManager->getOpenShares()); |
|
71 | - } |
|
63 | + /** |
|
64 | + * @NoAdminRequired |
|
65 | + * @NoOutgoingFederatedSharingRequired |
|
66 | + * |
|
67 | + * @return JSONResponse |
|
68 | + */ |
|
69 | + public function index() { |
|
70 | + return new JSONResponse($this->externalManager->getOpenShares()); |
|
71 | + } |
|
72 | 72 | |
73 | - /** |
|
74 | - * @NoAdminRequired |
|
75 | - * @NoOutgoingFederatedSharingRequired |
|
76 | - * |
|
77 | - * @param int $id |
|
78 | - * @return JSONResponse |
|
79 | - */ |
|
80 | - public function create($id) { |
|
81 | - $this->externalManager->acceptShare($id); |
|
82 | - return new JSONResponse(); |
|
83 | - } |
|
73 | + /** |
|
74 | + * @NoAdminRequired |
|
75 | + * @NoOutgoingFederatedSharingRequired |
|
76 | + * |
|
77 | + * @param int $id |
|
78 | + * @return JSONResponse |
|
79 | + */ |
|
80 | + public function create($id) { |
|
81 | + $this->externalManager->acceptShare($id); |
|
82 | + return new JSONResponse(); |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * @NoAdminRequired |
|
87 | - * @NoOutgoingFederatedSharingRequired |
|
88 | - * |
|
89 | - * @param integer $id |
|
90 | - * @return JSONResponse |
|
91 | - */ |
|
92 | - public function destroy($id) { |
|
93 | - $this->externalManager->declineShare($id); |
|
94 | - return new JSONResponse(); |
|
95 | - } |
|
85 | + /** |
|
86 | + * @NoAdminRequired |
|
87 | + * @NoOutgoingFederatedSharingRequired |
|
88 | + * |
|
89 | + * @param integer $id |
|
90 | + * @return JSONResponse |
|
91 | + */ |
|
92 | + public function destroy($id) { |
|
93 | + $this->externalManager->declineShare($id); |
|
94 | + return new JSONResponse(); |
|
95 | + } |
|
96 | 96 | |
97 | - /** |
|
98 | - * Test whether the specified remote is accessible |
|
99 | - * |
|
100 | - * @param string $remote |
|
101 | - * @param bool $checkVersion |
|
102 | - * @return bool |
|
103 | - */ |
|
104 | - protected function testUrl($remote, $checkVersion = false) { |
|
105 | - try { |
|
106 | - $client = $this->clientService->newClient(); |
|
107 | - $response = json_decode($client->get( |
|
108 | - $remote, |
|
109 | - [ |
|
110 | - 'timeout' => 3, |
|
111 | - 'connect_timeout' => 3, |
|
112 | - ] |
|
113 | - )->getBody()); |
|
97 | + /** |
|
98 | + * Test whether the specified remote is accessible |
|
99 | + * |
|
100 | + * @param string $remote |
|
101 | + * @param bool $checkVersion |
|
102 | + * @return bool |
|
103 | + */ |
|
104 | + protected function testUrl($remote, $checkVersion = false) { |
|
105 | + try { |
|
106 | + $client = $this->clientService->newClient(); |
|
107 | + $response = json_decode($client->get( |
|
108 | + $remote, |
|
109 | + [ |
|
110 | + 'timeout' => 3, |
|
111 | + 'connect_timeout' => 3, |
|
112 | + ] |
|
113 | + )->getBody()); |
|
114 | 114 | |
115 | - if ($checkVersion) { |
|
116 | - return !empty($response->version) && version_compare($response->version, '7.0.0', '>='); |
|
117 | - } else { |
|
118 | - return is_object($response); |
|
119 | - } |
|
120 | - } catch (\Exception $e) { |
|
121 | - return false; |
|
122 | - } |
|
123 | - } |
|
115 | + if ($checkVersion) { |
|
116 | + return !empty($response->version) && version_compare($response->version, '7.0.0', '>='); |
|
117 | + } else { |
|
118 | + return is_object($response); |
|
119 | + } |
|
120 | + } catch (\Exception $e) { |
|
121 | + return false; |
|
122 | + } |
|
123 | + } |
|
124 | 124 | |
125 | - /** |
|
126 | - * @PublicPage |
|
127 | - * @NoOutgoingFederatedSharingRequired |
|
128 | - * @NoIncomingFederatedSharingRequired |
|
129 | - * |
|
130 | - * @param string $remote |
|
131 | - * @return DataResponse |
|
132 | - */ |
|
133 | - public function testRemote($remote) { |
|
134 | - if (strpos($remote, '#') !== false || strpos($remote, '?') !== false || strpos($remote, ';') !== false) { |
|
135 | - return new DataResponse(false); |
|
136 | - } |
|
125 | + /** |
|
126 | + * @PublicPage |
|
127 | + * @NoOutgoingFederatedSharingRequired |
|
128 | + * @NoIncomingFederatedSharingRequired |
|
129 | + * |
|
130 | + * @param string $remote |
|
131 | + * @return DataResponse |
|
132 | + */ |
|
133 | + public function testRemote($remote) { |
|
134 | + if (strpos($remote, '#') !== false || strpos($remote, '?') !== false || strpos($remote, ';') !== false) { |
|
135 | + return new DataResponse(false); |
|
136 | + } |
|
137 | 137 | |
138 | - if ( |
|
139 | - $this->testUrl('https://' . $remote . '/ocs-provider/') || |
|
140 | - $this->testUrl('https://' . $remote . '/ocs-provider/index.php') || |
|
141 | - $this->testUrl('https://' . $remote . '/status.php', true) |
|
142 | - ) { |
|
143 | - return new DataResponse('https'); |
|
144 | - } elseif ( |
|
145 | - $this->testUrl('http://' . $remote . '/ocs-provider/') || |
|
146 | - $this->testUrl('http://' . $remote . '/ocs-provider/index.php') || |
|
147 | - $this->testUrl('http://' . $remote . '/status.php', true) |
|
148 | - ) { |
|
149 | - return new DataResponse('http'); |
|
150 | - } else { |
|
151 | - return new DataResponse(false); |
|
152 | - } |
|
153 | - } |
|
138 | + if ( |
|
139 | + $this->testUrl('https://' . $remote . '/ocs-provider/') || |
|
140 | + $this->testUrl('https://' . $remote . '/ocs-provider/index.php') || |
|
141 | + $this->testUrl('https://' . $remote . '/status.php', true) |
|
142 | + ) { |
|
143 | + return new DataResponse('https'); |
|
144 | + } elseif ( |
|
145 | + $this->testUrl('http://' . $remote . '/ocs-provider/') || |
|
146 | + $this->testUrl('http://' . $remote . '/ocs-provider/index.php') || |
|
147 | + $this->testUrl('http://' . $remote . '/status.php', true) |
|
148 | + ) { |
|
149 | + return new DataResponse('http'); |
|
150 | + } else { |
|
151 | + return new DataResponse(false); |
|
152 | + } |
|
153 | + } |
|
154 | 154 | } |
@@ -33,61 +33,61 @@ |
||
33 | 33 | |
34 | 34 | class Version010000Date20200304152605 extends SimpleMigrationStep { |
35 | 35 | |
36 | - /** |
|
37 | - * @param IOutput $output |
|
38 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
39 | - * @param array $options |
|
40 | - * |
|
41 | - * @return ISchemaWrapper |
|
42 | - */ |
|
43 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ISchemaWrapper { |
|
44 | - /** @var ISchemaWrapper $schema */ |
|
45 | - $schema = $schemaClosure(); |
|
36 | + /** |
|
37 | + * @param IOutput $output |
|
38 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
39 | + * @param array $options |
|
40 | + * |
|
41 | + * @return ISchemaWrapper |
|
42 | + */ |
|
43 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ISchemaWrapper { |
|
44 | + /** @var ISchemaWrapper $schema */ |
|
45 | + $schema = $schemaClosure(); |
|
46 | 46 | |
47 | - $table = $schema->createTable(RecentContactMapper::TABLE_NAME); |
|
48 | - $table->addColumn('id', 'integer', [ |
|
49 | - 'autoincrement' => true, |
|
50 | - 'notnull' => true, |
|
51 | - 'length' => 4, |
|
52 | - ]); |
|
53 | - $table->addColumn('actor_uid', 'string', [ |
|
54 | - 'notnull' => true, |
|
55 | - 'length' => 64, |
|
56 | - ]); |
|
57 | - $table->addColumn('uid', 'string', [ |
|
58 | - 'notnull' => false, |
|
59 | - 'length' => 64, |
|
60 | - ]); |
|
61 | - $table->addColumn('email', 'string', [ |
|
62 | - 'notnull' => false, |
|
63 | - 'length' => 255, |
|
64 | - ]); |
|
65 | - $table->addColumn('federated_cloud_id', 'string', [ |
|
66 | - 'notnull' => false, |
|
67 | - 'length' => 255, |
|
68 | - ]); |
|
69 | - $table->addColumn('card', 'blob', [ |
|
70 | - 'notnull' => true, |
|
71 | - ]); |
|
72 | - $table->addColumn('last_contact', 'integer', [ |
|
73 | - 'notnull' => true, |
|
74 | - 'length' => 4, |
|
75 | - ]); |
|
76 | - $table->setPrimaryKey(['id']); |
|
77 | - // To find all recent entries |
|
78 | - $table->addIndex(['actor_uid'], RecentContactMapper::TABLE_NAME . '_actor_uid'); |
|
79 | - // To find a specific entry |
|
80 | - $table->addIndex(['id', 'actor_uid'], RecentContactMapper::TABLE_NAME . '_id_uid'); |
|
81 | - // To find all recent entries with a given UID |
|
82 | - $table->addIndex(['uid'], RecentContactMapper::TABLE_NAME . '_uid'); |
|
83 | - // To find all recent entries with a given email address |
|
84 | - $table->addIndex(['email'], RecentContactMapper::TABLE_NAME . '_email'); |
|
85 | - // To find all recent entries with a give federated cloud id |
|
86 | - $table->addIndex(['federated_cloud_id'], RecentContactMapper::TABLE_NAME . '_fed_id'); |
|
87 | - // For the cleanup |
|
88 | - $table->addIndex(['last_contact'], RecentContactMapper::TABLE_NAME . '_last_contact'); |
|
47 | + $table = $schema->createTable(RecentContactMapper::TABLE_NAME); |
|
48 | + $table->addColumn('id', 'integer', [ |
|
49 | + 'autoincrement' => true, |
|
50 | + 'notnull' => true, |
|
51 | + 'length' => 4, |
|
52 | + ]); |
|
53 | + $table->addColumn('actor_uid', 'string', [ |
|
54 | + 'notnull' => true, |
|
55 | + 'length' => 64, |
|
56 | + ]); |
|
57 | + $table->addColumn('uid', 'string', [ |
|
58 | + 'notnull' => false, |
|
59 | + 'length' => 64, |
|
60 | + ]); |
|
61 | + $table->addColumn('email', 'string', [ |
|
62 | + 'notnull' => false, |
|
63 | + 'length' => 255, |
|
64 | + ]); |
|
65 | + $table->addColumn('federated_cloud_id', 'string', [ |
|
66 | + 'notnull' => false, |
|
67 | + 'length' => 255, |
|
68 | + ]); |
|
69 | + $table->addColumn('card', 'blob', [ |
|
70 | + 'notnull' => true, |
|
71 | + ]); |
|
72 | + $table->addColumn('last_contact', 'integer', [ |
|
73 | + 'notnull' => true, |
|
74 | + 'length' => 4, |
|
75 | + ]); |
|
76 | + $table->setPrimaryKey(['id']); |
|
77 | + // To find all recent entries |
|
78 | + $table->addIndex(['actor_uid'], RecentContactMapper::TABLE_NAME . '_actor_uid'); |
|
79 | + // To find a specific entry |
|
80 | + $table->addIndex(['id', 'actor_uid'], RecentContactMapper::TABLE_NAME . '_id_uid'); |
|
81 | + // To find all recent entries with a given UID |
|
82 | + $table->addIndex(['uid'], RecentContactMapper::TABLE_NAME . '_uid'); |
|
83 | + // To find all recent entries with a given email address |
|
84 | + $table->addIndex(['email'], RecentContactMapper::TABLE_NAME . '_email'); |
|
85 | + // To find all recent entries with a give federated cloud id |
|
86 | + $table->addIndex(['federated_cloud_id'], RecentContactMapper::TABLE_NAME . '_fed_id'); |
|
87 | + // For the cleanup |
|
88 | + $table->addIndex(['last_contact'], RecentContactMapper::TABLE_NAME . '_last_contact'); |
|
89 | 89 | |
90 | - return $schema; |
|
91 | - } |
|
90 | + return $schema; |
|
91 | + } |
|
92 | 92 | |
93 | 93 | } |
@@ -75,17 +75,17 @@ |
||
75 | 75 | ]); |
76 | 76 | $table->setPrimaryKey(['id']); |
77 | 77 | // To find all recent entries |
78 | - $table->addIndex(['actor_uid'], RecentContactMapper::TABLE_NAME . '_actor_uid'); |
|
78 | + $table->addIndex(['actor_uid'], RecentContactMapper::TABLE_NAME.'_actor_uid'); |
|
79 | 79 | // To find a specific entry |
80 | - $table->addIndex(['id', 'actor_uid'], RecentContactMapper::TABLE_NAME . '_id_uid'); |
|
80 | + $table->addIndex(['id', 'actor_uid'], RecentContactMapper::TABLE_NAME.'_id_uid'); |
|
81 | 81 | // To find all recent entries with a given UID |
82 | - $table->addIndex(['uid'], RecentContactMapper::TABLE_NAME . '_uid'); |
|
82 | + $table->addIndex(['uid'], RecentContactMapper::TABLE_NAME.'_uid'); |
|
83 | 83 | // To find all recent entries with a given email address |
84 | - $table->addIndex(['email'], RecentContactMapper::TABLE_NAME . '_email'); |
|
84 | + $table->addIndex(['email'], RecentContactMapper::TABLE_NAME.'_email'); |
|
85 | 85 | // To find all recent entries with a give federated cloud id |
86 | - $table->addIndex(['federated_cloud_id'], RecentContactMapper::TABLE_NAME . '_fed_id'); |
|
86 | + $table->addIndex(['federated_cloud_id'], RecentContactMapper::TABLE_NAME.'_fed_id'); |
|
87 | 87 | // For the cleanup |
88 | - $table->addIndex(['last_contact'], RecentContactMapper::TABLE_NAME . '_last_contact'); |
|
88 | + $table->addIndex(['last_contact'], RecentContactMapper::TABLE_NAME.'_last_contact'); |
|
89 | 89 | |
90 | 90 | return $schema; |
91 | 91 | } |
@@ -67,7 +67,7 @@ |
||
67 | 67 | } |
68 | 68 | $addressbooksQuery->selectDistinct('id') |
69 | 69 | ->from('addressbooks') |
70 | - ->where($addressbooksQuery->expr()->eq('principaluri', $cardQuery->createNamedParameter("principals/users/" . $user->getUID()))); |
|
70 | + ->where($addressbooksQuery->expr()->eq('principaluri', $cardQuery->createNamedParameter("principals/users/".$user->getUID()))); |
|
71 | 71 | $propQuery->selectDistinct('cardid') |
72 | 72 | ->from('cards_properties') |
73 | 73 | ->where($propQuery->expr()->in('addressbookid', $propQuery->createFunction($addressbooksQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY)) |
@@ -32,63 +32,63 @@ |
||
32 | 32 | use function stream_get_contents; |
33 | 33 | |
34 | 34 | class CardSearchDao { |
35 | - private IDBConnection $db; |
|
35 | + private IDBConnection $db; |
|
36 | 36 | |
37 | - public function __construct(IDBConnection $db) { |
|
38 | - $this->db = $db; |
|
39 | - } |
|
37 | + public function __construct(IDBConnection $db) { |
|
38 | + $this->db = $db; |
|
39 | + } |
|
40 | 40 | |
41 | - public function findExisting(IUser $user, |
|
42 | - ?string $uid, |
|
43 | - ?string $email, |
|
44 | - ?string $cloudId): ?string { |
|
45 | - $addressbooksQuery = $this->db->getQueryBuilder(); |
|
46 | - $cardQuery = $this->db->getQueryBuilder(); |
|
47 | - $propQuery = $this->db->getQueryBuilder(); |
|
41 | + public function findExisting(IUser $user, |
|
42 | + ?string $uid, |
|
43 | + ?string $email, |
|
44 | + ?string $cloudId): ?string { |
|
45 | + $addressbooksQuery = $this->db->getQueryBuilder(); |
|
46 | + $cardQuery = $this->db->getQueryBuilder(); |
|
47 | + $propQuery = $this->db->getQueryBuilder(); |
|
48 | 48 | |
49 | - $propOr = $propQuery->expr()->orX(); |
|
50 | - if ($uid !== null) { |
|
51 | - $propOr->add($propQuery->expr()->andX( |
|
52 | - $propQuery->expr()->eq('name', $cardQuery->createNamedParameter('UID')), |
|
53 | - $propQuery->expr()->eq('value', $cardQuery->createNamedParameter($uid)) |
|
54 | - )); |
|
55 | - } |
|
56 | - if ($email !== null) { |
|
57 | - $propOr->add($propQuery->expr()->andX( |
|
58 | - $propQuery->expr()->eq('name', $cardQuery->createNamedParameter('EMAIL')), |
|
59 | - $propQuery->expr()->eq('value', $cardQuery->createNamedParameter($email)) |
|
60 | - )); |
|
61 | - } |
|
62 | - if ($cloudId !== null) { |
|
63 | - $propOr->add($propQuery->expr()->andX( |
|
64 | - $propQuery->expr()->eq('name', $cardQuery->createNamedParameter('CLOUD')), |
|
65 | - $propQuery->expr()->eq('value', $cardQuery->createNamedParameter($cloudId)) |
|
66 | - )); |
|
67 | - } |
|
68 | - $addressbooksQuery->selectDistinct('id') |
|
69 | - ->from('addressbooks') |
|
70 | - ->where($addressbooksQuery->expr()->eq('principaluri', $cardQuery->createNamedParameter("principals/users/" . $user->getUID()))); |
|
71 | - $propQuery->selectDistinct('cardid') |
|
72 | - ->from('cards_properties') |
|
73 | - ->where($propQuery->expr()->in('addressbookid', $propQuery->createFunction($addressbooksQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY)) |
|
74 | - ->andWhere($propOr) |
|
75 | - ->groupBy('cardid'); |
|
76 | - $cardQuery->select('carddata') |
|
77 | - ->from('cards') |
|
78 | - ->where($cardQuery->expr()->in('id', $cardQuery->createFunction($propQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY)) |
|
79 | - ->andWhere($cardQuery->expr()->in('addressbookid', $cardQuery->createFunction($addressbooksQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY)) |
|
80 | - ->setMaxResults(1); |
|
81 | - $result = $cardQuery->execute(); |
|
82 | - /** @var string|resource|false $card */ |
|
83 | - $card = $result->fetchOne(); |
|
49 | + $propOr = $propQuery->expr()->orX(); |
|
50 | + if ($uid !== null) { |
|
51 | + $propOr->add($propQuery->expr()->andX( |
|
52 | + $propQuery->expr()->eq('name', $cardQuery->createNamedParameter('UID')), |
|
53 | + $propQuery->expr()->eq('value', $cardQuery->createNamedParameter($uid)) |
|
54 | + )); |
|
55 | + } |
|
56 | + if ($email !== null) { |
|
57 | + $propOr->add($propQuery->expr()->andX( |
|
58 | + $propQuery->expr()->eq('name', $cardQuery->createNamedParameter('EMAIL')), |
|
59 | + $propQuery->expr()->eq('value', $cardQuery->createNamedParameter($email)) |
|
60 | + )); |
|
61 | + } |
|
62 | + if ($cloudId !== null) { |
|
63 | + $propOr->add($propQuery->expr()->andX( |
|
64 | + $propQuery->expr()->eq('name', $cardQuery->createNamedParameter('CLOUD')), |
|
65 | + $propQuery->expr()->eq('value', $cardQuery->createNamedParameter($cloudId)) |
|
66 | + )); |
|
67 | + } |
|
68 | + $addressbooksQuery->selectDistinct('id') |
|
69 | + ->from('addressbooks') |
|
70 | + ->where($addressbooksQuery->expr()->eq('principaluri', $cardQuery->createNamedParameter("principals/users/" . $user->getUID()))); |
|
71 | + $propQuery->selectDistinct('cardid') |
|
72 | + ->from('cards_properties') |
|
73 | + ->where($propQuery->expr()->in('addressbookid', $propQuery->createFunction($addressbooksQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY)) |
|
74 | + ->andWhere($propOr) |
|
75 | + ->groupBy('cardid'); |
|
76 | + $cardQuery->select('carddata') |
|
77 | + ->from('cards') |
|
78 | + ->where($cardQuery->expr()->in('id', $cardQuery->createFunction($propQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY)) |
|
79 | + ->andWhere($cardQuery->expr()->in('addressbookid', $cardQuery->createFunction($addressbooksQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY)) |
|
80 | + ->setMaxResults(1); |
|
81 | + $result = $cardQuery->execute(); |
|
82 | + /** @var string|resource|false $card */ |
|
83 | + $card = $result->fetchOne(); |
|
84 | 84 | |
85 | - if ($card === false) { |
|
86 | - return null; |
|
87 | - } |
|
88 | - if (is_resource($card)) { |
|
89 | - return stream_get_contents($card); |
|
90 | - } |
|
85 | + if ($card === false) { |
|
86 | + return null; |
|
87 | + } |
|
88 | + if (is_resource($card)) { |
|
89 | + return stream_get_contents($card); |
|
90 | + } |
|
91 | 91 | |
92 | - return $card; |
|
93 | - } |
|
92 | + return $card; |
|
93 | + } |
|
94 | 94 | } |
@@ -33,49 +33,49 @@ |
||
33 | 33 | |
34 | 34 | class AddressBookProvider implements IAddressBookProvider { |
35 | 35 | |
36 | - /** @var RecentContactMapper */ |
|
37 | - private $mapper; |
|
36 | + /** @var RecentContactMapper */ |
|
37 | + private $mapper; |
|
38 | 38 | |
39 | - /** @var IL10N */ |
|
40 | - private $l10n; |
|
39 | + /** @var IL10N */ |
|
40 | + private $l10n; |
|
41 | 41 | |
42 | - public function __construct(RecentContactMapper $mapper, IL10N $l10n) { |
|
43 | - $this->mapper = $mapper; |
|
44 | - $this->l10n = $l10n; |
|
45 | - } |
|
42 | + public function __construct(RecentContactMapper $mapper, IL10N $l10n) { |
|
43 | + $this->mapper = $mapper; |
|
44 | + $this->l10n = $l10n; |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * @inheritDoc |
|
49 | - */ |
|
50 | - public function getAppId(): string { |
|
51 | - return Application::APP_ID; |
|
52 | - } |
|
47 | + /** |
|
48 | + * @inheritDoc |
|
49 | + */ |
|
50 | + public function getAppId(): string { |
|
51 | + return Application::APP_ID; |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * @inheritDoc |
|
56 | - */ |
|
57 | - public function fetchAllForAddressBookHome(string $principalUri): array { |
|
58 | - return [ |
|
59 | - new AddressBook($this->mapper, $this->l10n, $principalUri) |
|
60 | - ]; |
|
61 | - } |
|
54 | + /** |
|
55 | + * @inheritDoc |
|
56 | + */ |
|
57 | + public function fetchAllForAddressBookHome(string $principalUri): array { |
|
58 | + return [ |
|
59 | + new AddressBook($this->mapper, $this->l10n, $principalUri) |
|
60 | + ]; |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * @inheritDoc |
|
65 | - */ |
|
66 | - public function hasAddressBookInAddressBookHome(string $principalUri, string $uri): bool { |
|
67 | - return $uri === AddressBook::URI; |
|
68 | - } |
|
63 | + /** |
|
64 | + * @inheritDoc |
|
65 | + */ |
|
66 | + public function hasAddressBookInAddressBookHome(string $principalUri, string $uri): bool { |
|
67 | + return $uri === AddressBook::URI; |
|
68 | + } |
|
69 | 69 | |
70 | - /** |
|
71 | - * @inheritDoc |
|
72 | - */ |
|
73 | - public function getAddressBookInAddressBookHome(string $principalUri, string $uri): ?ExternalAddressBook { |
|
74 | - if ($uri === AddressBook::URI) { |
|
75 | - return new AddressBook($this->mapper, $this->l10n, $principalUri); |
|
76 | - } |
|
70 | + /** |
|
71 | + * @inheritDoc |
|
72 | + */ |
|
73 | + public function getAddressBookInAddressBookHome(string $principalUri, string $uri): ?ExternalAddressBook { |
|
74 | + if ($uri === AddressBook::URI) { |
|
75 | + return new AddressBook($this->mapper, $this->l10n, $principalUri); |
|
76 | + } |
|
77 | 77 | |
78 | - return null; |
|
79 | - } |
|
78 | + return null; |
|
79 | + } |
|
80 | 80 | |
81 | 81 | } |
@@ -6,5 +6,5 @@ |
||
6 | 6 | $baseDir = $vendorDir; |
7 | 7 | |
8 | 8 | return array( |
9 | - 'OCA\\ContactsInteraction\\' => array($baseDir . '/../lib'), |
|
9 | + 'OCA\\ContactsInteraction\\' => array($baseDir.'/../lib'), |
|
10 | 10 | ); |