|
@@ 711-716 (lines=6) @@
|
| 708 |
|
throw new \Exception($message_t); |
| 709 |
|
} |
| 710 |
|
// verify that the user has share permission |
| 711 |
|
if (!\OC\Files\Filesystem::isSharable($path) || \OCP\Util::isSharingDisabledForUser()) { |
| 712 |
|
$message = 'You are not allowed to share %s'; |
| 713 |
|
$message_t = $l->t('You are not allowed to share %s', [$path]); |
| 714 |
|
\OCP\Util::writeLog('OCP\Share', sprintf($message, $path), \OCP\Util::DEBUG); |
| 715 |
|
throw new \Exception($message_t); |
| 716 |
|
} |
| 717 |
|
} |
| 718 |
|
|
| 719 |
|
//verify that we don't share a folder which already contains a share mount point |
|
@@ 762-767 (lines=6) @@
|
| 759 |
|
\OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName), \OCP\Util::DEBUG); |
| 760 |
|
throw new \Exception($message_t); |
| 761 |
|
} |
| 762 |
|
if (!\OC_User::userExists($shareWith)) { |
| 763 |
|
$message = 'Sharing %s failed, because the user %s does not exist'; |
| 764 |
|
$message_t = $l->t('Sharing %s failed, because the user %s does not exist', array($itemSourceName, $shareWith)); |
| 765 |
|
\OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OCP\Util::DEBUG); |
| 766 |
|
throw new \Exception($message_t); |
| 767 |
|
} |
| 768 |
|
if ($shareWithinGroupOnly) { |
| 769 |
|
$userManager = \OC::$server->getUserManager(); |
| 770 |
|
$groupManager = \OC::$server->getGroupManager(); |
|
@@ 1621-1626 (lines=6) @@
|
| 1618 |
|
$class = self::$backendTypes[$itemType]['class']; |
| 1619 |
|
if (class_exists($class)) { |
| 1620 |
|
self::$backends[$itemType] = new $class; |
| 1621 |
|
if (!(self::$backends[$itemType] instanceof \OCP\Share_Backend)) { |
| 1622 |
|
$message = 'Sharing backend %s must implement the interface OCP\Share_Backend'; |
| 1623 |
|
$message_t = $l->t('Sharing backend %s must implement the interface OCP\Share_Backend', array($class)); |
| 1624 |
|
\OCP\Util::writeLog('OCP\Share', sprintf($message, $class), \OCP\Util::ERROR); |
| 1625 |
|
throw new \Exception($message_t); |
| 1626 |
|
} |
| 1627 |
|
return self::$backends[$itemType]; |
| 1628 |
|
} else { |
| 1629 |
|
$message = 'Sharing backend %s not found'; |