|
@@ 374-384 (lines=11) @@
|
| 371 |
|
* Manage sharing events |
| 372 |
|
* @param array $params The hook params |
| 373 |
|
*/ |
| 374 |
|
public function share($params) { |
| 375 |
|
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
| 376 |
|
if ((int) $params['shareType'] === Share::SHARE_TYPE_USER) { |
| 377 |
|
$this->shareFileOrFolderWithUser($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], true); |
| 378 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_GROUP) { |
| 379 |
|
$this->shareFileOrFolderWithGroup($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], (int) $params['id'], true); |
| 380 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_LINK) { |
| 381 |
|
$this->shareFileOrFolderByLink((int) $params['fileSource'], $params['itemType'], $params['uidOwner'], true); |
| 382 |
|
} |
| 383 |
|
} |
| 384 |
|
} |
| 385 |
|
|
| 386 |
|
/** |
| 387 |
|
* Manage sharing events |
|
@@ 390-400 (lines=11) @@
|
| 387 |
|
* Manage sharing events |
| 388 |
|
* @param array $params The hook params |
| 389 |
|
*/ |
| 390 |
|
public function unShare($params) { |
| 391 |
|
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
| 392 |
|
if ((int) $params['shareType'] === Share::SHARE_TYPE_USER) { |
| 393 |
|
$this->shareFileOrFolderWithUser($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], false); |
| 394 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_GROUP) { |
| 395 |
|
$this->shareFileOrFolderWithGroup($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], (int) $params['id'], false); |
| 396 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_LINK) { |
| 397 |
|
$this->shareFileOrFolderByLink((int) $params['fileSource'], $params['itemType'], $params['uidOwner'], false); |
| 398 |
|
} |
| 399 |
|
} |
| 400 |
|
} |
| 401 |
|
|
| 402 |
|
/** |
| 403 |
|
* Sharing a file or folder with a user |