From b26b8d17ebcd843ddba35bf446f3f5a7655ee38d Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 7 Mar 2016 10:40:49 +0100 Subject: Remove support for old shares in the default share provider In 9.0 we converted the old shares to the new shares. So for 9.1 we can savely remove the fallback code. This code was required when there was no initiator set. * Fixed unit tests --- lib/private/Share20/DefaultShareProvider.php | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'lib/private/Share20/DefaultShareProvider.php') diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index b91ac24d44f..b5963e0e3c4 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -471,18 +471,7 @@ class DefaultShareProvider implements IShareProvider { * Reshares for this user are shares where they are the owner. */ if ($reshares === false) { - //Special case for old shares created via the web UI - $or1 = $qb->expr()->andX( - $qb->expr()->eq('uid_owner', $qb->createNamedParameter($userId)), - $qb->expr()->isNull('uid_initiator') - ); - - $qb->andWhere( - $qb->expr()->orX( - $qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId)), - $or1 - ) - ); + $qb->andWhere($qb->expr()->eq('uid_initiator', $qb->createNamedParameter($userId))); } else { $qb->andWhere( $qb->expr()->orX( @@ -765,18 +754,8 @@ class DefaultShareProvider implements IShareProvider { $share->setToken($data['token']); } - if ($data['uid_initiator'] === null) { - //OLD SHARE - $share->setSharedBy($data['uid_owner']); - $path = $this->getNode($share->getSharedBy(), (int)$data['file_source']); - - $owner = $path->getOwner(); - $share->setShareOwner($owner->getUID()); - } else { - //New share! - $share->setSharedBy($data['uid_initiator']); - $share->setShareOwner($data['uid_owner']); - } + $share->setSharedBy($data['uid_initiator']); + $share->setShareOwner($data['uid_owner']); $share->setNodeId((int)$data['file_source']); $share->setNodeType($data['item_type']); -- cgit v1.2.3