@@ 216-226 (lines=11) @@ | ||
213 | * Manage sharing events |
|
214 | * @param array $params The hook params |
|
215 | */ |
|
216 | public function share($params) { |
|
217 | if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
|
218 | if ((int) $params['shareType'] === Share::SHARE_TYPE_USER) { |
|
219 | $this->shareFileOrFolderWithUser($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], true); |
|
220 | } else if ((int) $params['shareType'] === Share::SHARE_TYPE_GROUP) { |
|
221 | $this->shareFileOrFolderWithGroup($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], (int) $params['id'], true); |
|
222 | } else if ((int) $params['shareType'] === Share::SHARE_TYPE_LINK) { |
|
223 | $this->shareFileOrFolderByLink((int) $params['fileSource'], $params['itemType'], $params['uidOwner'], true); |
|
224 | } |
|
225 | } |
|
226 | } |
|
227 | ||
228 | /** |
|
229 | * Manage sharing events |
|
@@ 232-242 (lines=11) @@ | ||
229 | * Manage sharing events |
|
230 | * @param array $params The hook params |
|
231 | */ |
|
232 | public function unShare($params) { |
|
233 | if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
|
234 | if ((int) $params['shareType'] === Share::SHARE_TYPE_USER) { |
|
235 | $this->shareFileOrFolderWithUser($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], false); |
|
236 | } else if ((int) $params['shareType'] === Share::SHARE_TYPE_GROUP) { |
|
237 | $this->shareFileOrFolderWithGroup($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], (int) $params['id'], false); |
|
238 | } else if ((int) $params['shareType'] === Share::SHARE_TYPE_LINK) { |
|
239 | $this->shareFileOrFolderByLink((int) $params['fileSource'], $params['itemType'], $params['uidOwner'], false); |
|
240 | } |
|
241 | } |
|
242 | } |
|
243 | ||
244 | /** |
|
245 | * Sharing a file or folder with a user |