aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-08-01 20:08:18 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-08-01 20:08:18 -0400
commit6c7baacf8959e32c6702b68357bc85b286c67940 (patch)
treef9ed96fe4c5838edbd3d9c975bd472c7e425925a
parent26e406c3c0ec478f29095d1d03cbb3afe04aa160 (diff)
downloadnextcloud-server-6c7baacf8959e32c6702b68357bc85b286c67940.tar.gz
nextcloud-server-6c7baacf8959e32c6702b68357bc85b286c67940.zip
Throw exception for items already shared in a collection
-rw-r--r--lib/public/share.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index 5eb690b510b..2b36a06abf2 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -225,11 +225,12 @@ class Share {
}
if ($collectionTypes = self::getCollectionItemTypes($itemType)) {
foreach ($collectionTypes as $collectionType) {
- $collections = self::getItems($collectionType, null, self::SHARE_TYPE_USER, $shareWith, $uidOwner);
+ $collections = self::getItems($collectionType, null, self::$shareTypeUserAndGroups, $shareWith, $uidOwner);
if ($backend = self::getBackend($collectionType)) {
if ($backend->inCollection($collections, $item)) {
- \OC_Log::write('OCP\Share', 'Sharing '.$item.' failed, because this item is already shared with '.$shareWith.' inside a collection', \OC_Log::ERROR);
- return false;
+ $message = 'Sharing '.$item.' failed, because this item is already shared with '.$shareWith.' inside a collection';
+ \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
+ throw new \Exception($message);
}
}
}