|
@@ 247-257 (lines=11) @@
|
| 244 |
|
* Manage sharing events |
| 245 |
|
* @param array $params The hook params |
| 246 |
|
*/ |
| 247 |
|
public function share($params) { |
| 248 |
|
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
| 249 |
|
if ((int) $params['shareType'] === Share::SHARE_TYPE_USER) { |
| 250 |
|
$this->shareFileOrFolderWithUser($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], true); |
| 251 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_GROUP) { |
| 252 |
|
$this->shareFileOrFolderWithGroup($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], (int) $params['id'], true); |
| 253 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_LINK) { |
| 254 |
|
$this->shareFileOrFolderByLink((int) $params['fileSource'], $params['itemType'], $params['uidOwner'], true); |
| 255 |
|
} |
| 256 |
|
} |
| 257 |
|
} |
| 258 |
|
|
| 259 |
|
/** |
| 260 |
|
* Manage sharing events |
|
@@ 263-273 (lines=11) @@
|
| 260 |
|
* Manage sharing events |
| 261 |
|
* @param array $params The hook params |
| 262 |
|
*/ |
| 263 |
|
public function unShare($params) { |
| 264 |
|
if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { |
| 265 |
|
if ((int) $params['shareType'] === Share::SHARE_TYPE_USER) { |
| 266 |
|
$this->shareFileOrFolderWithUser($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], false); |
| 267 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_GROUP) { |
| 268 |
|
$this->shareFileOrFolderWithGroup($params['shareWith'], (int) $params['fileSource'], $params['itemType'], $params['fileTarget'], (int) $params['id'], false); |
| 269 |
|
} else if ((int) $params['shareType'] === Share::SHARE_TYPE_LINK) { |
| 270 |
|
$this->shareFileOrFolderByLink((int) $params['fileSource'], $params['itemType'], $params['uidOwner'], false); |
| 271 |
|
} |
| 272 |
|
} |
| 273 |
|
} |
| 274 |
|
|
| 275 |
|
/** |
| 276 |
|
* Sharing a file or folder with a user |