|
@@ 579-589 (lines=11) @@
|
| 576 |
|
* Manage sharing events |
| 577 |
|
* @param array $params The hook params |
| 578 |
|
*/ |
| 579 |
|
public function share($params) { |
| 580 |
|
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
| 581 |
|
if ((int) $params['shareType'] === Share::SHARE_TYPE_USER) { |
| 582 |
|
$this->shareFileOrFolderWithUser($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], true); |
| 583 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_GROUP) { |
| 584 |
|
$this->shareFileOrFolderWithGroup($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], (int) $params['id'], true); |
| 585 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_LINK) { |
| 586 |
|
$this->shareFileOrFolderByLink((int) $params['fileSource'], $params['itemType'], $params['uidOwner'], true); |
| 587 |
|
} |
| 588 |
|
} |
| 589 |
|
} |
| 590 |
|
|
| 591 |
|
/** |
| 592 |
|
* Manage sharing events |
|
@@ 595-605 (lines=11) @@
|
| 592 |
|
* Manage sharing events |
| 593 |
|
* @param array $params The hook params |
| 594 |
|
*/ |
| 595 |
|
public function unShare($params) { |
| 596 |
|
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
| 597 |
|
if ((int) $params['shareType'] === Share::SHARE_TYPE_USER) { |
| 598 |
|
$this->shareFileOrFolderWithUser($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], false); |
| 599 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_GROUP) { |
| 600 |
|
$this->shareFileOrFolderWithGroup($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], (int) $params['id'], false); |
| 601 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_LINK) { |
| 602 |
|
$this->shareFileOrFolderByLink((int) $params['fileSource'], $params['itemType'], $params['uidOwner'], false); |
| 603 |
|
} |
| 604 |
|
} |
| 605 |
|
} |
| 606 |
|
|
| 607 |
|
/** |
| 608 |
|
* Sharing a file or folder with a user |