|
@@ 393-398 (lines=6) @@
|
| 390 |
|
throw new \Exception($message_t); |
| 391 |
|
} |
| 392 |
|
// verify that the user has share permission |
| 393 |
|
if (!\OC\Files\Filesystem::isSharable($path) || \OCP\Util::isSharingDisabledForUser()) { |
| 394 |
|
$message = 'You are not allowed to share %s'; |
| 395 |
|
$message_t = $l->t('You are not allowed to share %s', [$path]); |
| 396 |
|
\OCP\Util::writeLog('OCP\Share', sprintf($message, $path), \OCP\Util::DEBUG); |
| 397 |
|
throw new \Exception($message_t); |
| 398 |
|
} |
| 399 |
|
} |
| 400 |
|
|
| 401 |
|
//verify that we don't share a folder which already contains a share mount point |
|
@@ 444-449 (lines=6) @@
|
| 441 |
|
\OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName), \OCP\Util::DEBUG); |
| 442 |
|
throw new \Exception($message_t); |
| 443 |
|
} |
| 444 |
|
if (!\OC_User::userExists($shareWith)) { |
| 445 |
|
$message = 'Sharing %s failed, because the user %s does not exist'; |
| 446 |
|
$message_t = $l->t('Sharing %s failed, because the user %s does not exist', array($itemSourceName, $shareWith)); |
| 447 |
|
\OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OCP\Util::DEBUG); |
| 448 |
|
throw new \Exception($message_t); |
| 449 |
|
} |
| 450 |
|
if ($shareWithinGroupOnly) { |
| 451 |
|
$userManager = \OC::$server->getUserManager(); |
| 452 |
|
$groupManager = \OC::$server->getGroupManager(); |
|
@@ 954-959 (lines=6) @@
|
| 951 |
|
$class = self::$backendTypes[$itemType]['class']; |
| 952 |
|
if (class_exists($class)) { |
| 953 |
|
self::$backends[$itemType] = new $class; |
| 954 |
|
if (!(self::$backends[$itemType] instanceof \OCP\Share_Backend)) { |
| 955 |
|
$message = 'Sharing backend %s must implement the interface OCP\Share_Backend'; |
| 956 |
|
$message_t = $l->t('Sharing backend %s must implement the interface OCP\Share_Backend', array($class)); |
| 957 |
|
\OCP\Util::writeLog('OCP\Share', sprintf($message, $class), \OCP\Util::ERROR); |
| 958 |
|
throw new \Exception($message_t); |
| 959 |
|
} |
| 960 |
|
return self::$backends[$itemType]; |
| 961 |
|
} else { |
| 962 |
|
$message = 'Sharing backend %s not found'; |