|
@@ 434-440 (lines=7) @@
|
| 431 |
|
$groupsShareWith = $groupManager->getUserGroupIds($userShareWith); |
| 432 |
|
} |
| 433 |
|
$inGroup = array_intersect($groupsOwner, $groupsShareWith); |
| 434 |
|
if (empty($inGroup)) { |
| 435 |
|
$message = 'Sharing %s failed, because the user ' |
| 436 |
|
.'%s is not a member of any groups that %s is a member of'; |
| 437 |
|
$message_t = $l->t('Sharing %s failed, because the user %s is not a member of any groups that %s is a member of', array($itemName, $shareWith, $uidOwner)); |
| 438 |
|
\OCP\Util::writeLog('OCP\Share', sprintf($message, $itemName, $shareWith, $uidOwner), \OCP\Util::DEBUG); |
| 439 |
|
throw new \Exception($message_t); |
| 440 |
|
} |
| 441 |
|
} |
| 442 |
|
// Check if the item source is already shared with the user, either from the same owner or a different user |
| 443 |
|
if ($checkExists = self::getItems($itemType, $itemSource, self::$shareTypeUserAndGroups, |
|
@@ 1722-1728 (lines=7) @@
|
| 1719 |
|
$result['suggestedFileTarget'] = null; |
| 1720 |
|
$result['itemSource'] = $itemSource; |
| 1721 |
|
$result['expirationDate'] = $expirationDate; |
| 1722 |
|
if (!$backend->isValidSource($itemSource, $uidOwner)) { |
| 1723 |
|
$message = 'Sharing %s failed, because the sharing backend for ' |
| 1724 |
|
.'%s could not find its source'; |
| 1725 |
|
$message_t = $l->t('Sharing %s failed, because the sharing backend for %s could not find its source', array($itemSource, $itemType)); |
| 1726 |
|
\OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSource, $itemType), \OCP\Util::DEBUG); |
| 1727 |
|
throw new \Exception($message_t); |
| 1728 |
|
} |
| 1729 |
|
if ($backend instanceof \OCP\Share_Backend_File_Dependent) { |
| 1730 |
|
$result['filePath'] = $backend->getFilePath($itemSource, $uidOwner); |
| 1731 |
|
if ($itemType == 'file' || $itemType == 'folder') { |