|
@@ 542-552 (lines=11) @@
|
| 539 |
|
* Manage sharing events |
| 540 |
|
* @param array $params The hook params |
| 541 |
|
*/ |
| 542 |
|
public function share($params) { |
| 543 |
|
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
| 544 |
|
if ((int) $params['shareType'] === Share::SHARE_TYPE_USER) { |
| 545 |
|
$this->shareFileOrFolderWithUser($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], true); |
| 546 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_GROUP) { |
| 547 |
|
$this->shareFileOrFolderWithGroup($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], (int) $params['id'], true); |
| 548 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_LINK) { |
| 549 |
|
$this->shareFileOrFolderByLink((int) $params['fileSource'], $params['itemType'], $params['uidOwner'], true); |
| 550 |
|
} |
| 551 |
|
} |
| 552 |
|
} |
| 553 |
|
|
| 554 |
|
/** |
| 555 |
|
* Manage sharing events |
|
@@ 558-568 (lines=11) @@
|
| 555 |
|
* Manage sharing events |
| 556 |
|
* @param array $params The hook params |
| 557 |
|
*/ |
| 558 |
|
public function unShare($params) { |
| 559 |
|
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
| 560 |
|
if ((int) $params['shareType'] === Share::SHARE_TYPE_USER) { |
| 561 |
|
$this->shareFileOrFolderWithUser($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], false); |
| 562 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_GROUP) { |
| 563 |
|
$this->shareFileOrFolderWithGroup($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], (int) $params['id'], false); |
| 564 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_LINK) { |
| 565 |
|
$this->shareFileOrFolderByLink((int) $params['fileSource'], $params['itemType'], $params['uidOwner'], false); |
| 566 |
|
} |
| 567 |
|
} |
| 568 |
|
} |
| 569 |
|
|
| 570 |
|
/** |
| 571 |
|
* Sharing a file or folder with a user |