|
@@ 556-566 (lines=11) @@
|
| 553 |
|
* Manage sharing events |
| 554 |
|
* @param array $params The hook params |
| 555 |
|
*/ |
| 556 |
|
public function share($params) { |
| 557 |
|
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
| 558 |
|
if ((int) $params['shareType'] === Share::SHARE_TYPE_USER) { |
| 559 |
|
$this->shareFileOrFolderWithUser($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], true); |
| 560 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_GROUP) { |
| 561 |
|
$this->shareFileOrFolderWithGroup($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], (int) $params['id'], true); |
| 562 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_LINK) { |
| 563 |
|
$this->shareFileOrFolderByLink((int) $params['fileSource'], $params['itemType'], $params['uidOwner'], true); |
| 564 |
|
} |
| 565 |
|
} |
| 566 |
|
} |
| 567 |
|
|
| 568 |
|
/** |
| 569 |
|
* Manage sharing events |
|
@@ 572-582 (lines=11) @@
|
| 569 |
|
* Manage sharing events |
| 570 |
|
* @param array $params The hook params |
| 571 |
|
*/ |
| 572 |
|
public function unShare($params) { |
| 573 |
|
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
| 574 |
|
if ((int) $params['shareType'] === Share::SHARE_TYPE_USER) { |
| 575 |
|
$this->shareFileOrFolderWithUser($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], false); |
| 576 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_GROUP) { |
| 577 |
|
$this->shareFileOrFolderWithGroup($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], (int) $params['id'], false); |
| 578 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_LINK) { |
| 579 |
|
$this->shareFileOrFolderByLink((int) $params['fileSource'], $params['itemType'], $params['uidOwner'], false); |
| 580 |
|
} |
| 581 |
|
} |
| 582 |
|
} |
| 583 |
|
|
| 584 |
|
/** |
| 585 |
|
* Sharing a file or folder with a user |