summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-06-04 19:07:56 +0200
committerRobin Appelman <icewind@owncloud.com>2014-06-06 09:56:02 +0200
commit5bbfdc35d7d26625f406e24149f1a45708049e34 (patch)
treec6c5552c4fb797e63882772e0556af459c62e3b5 /lib
parent86d7371d0c797d5c97198eebf9152ad748961927 (diff)
downloadnextcloud-server-5bbfdc35d7d26625f406e24149f1a45708049e34.tar.gz
nextcloud-server-5bbfdc35d7d26625f406e24149f1a45708049e34.zip
make sure that we remove all shares refering to the same parent
Diffstat (limited to 'lib')
-rw-r--r--lib/private/share/helper.php21
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/private/share/helper.php b/lib/private/share/helper.php
index ab9e0ca4926..c92aa15b4bf 100644
--- a/lib/private/share/helper.php
+++ b/lib/private/share/helper.php
@@ -166,27 +166,6 @@ class Helper extends \OC\Share\Constants {
// Reset parents array, only go through loop again if items are found
$parents = array();
while ($item = $result->fetchRow()) {
- // Search for a duplicate parent share, this occurs when an
- // item is shared to the same user through a group and user or the
- // same item is shared by different users
- $userAndGroups = array_merge(array($item['uid_owner']), \OC_Group::getUserGroups($item['uid_owner']));
- $query = \OC_DB::prepare('SELECT `id`, `permissions` FROM `*PREFIX*share`'
- .' WHERE `item_type` = ?'
- .' AND `item_target` = ?'
- .' AND `share_type` IN (?,?,?)'
- .' AND `share_with` IN (\''.implode('\',\'', $userAndGroups).'\')'
- .' AND `uid_owner` != ? AND `id` != ?');
- $duplicateParent = $query->execute(array($item['item_type'], $item['item_target'],
- self::SHARE_TYPE_USER, self::SHARE_TYPE_GROUP, self::$shareTypeGroupUserUnique,
- $item['uid_owner'], $item['parent']))->fetchRow();
- if ($duplicateParent) {
- // Change the parent to the other item id if share permission is granted
- if ($duplicateParent['permissions'] & \OCP\PERMISSION_SHARE) {
- $query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `parent` = ? WHERE `id` = ?');
- $query->execute(array($duplicateParent['id'], $item['id']));
- continue;
- }
- }
$ids[] = $item['id'];
$parents[] = $item['id'];
}