diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-23 11:02:28 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-23 11:02:28 +0100 |
commit | fc18d33ff8a8b21ab38cf4e865152a16c91dc784 (patch) | |
tree | 4d96dfbf1b89fabea31694ed4d63fdd5e547bfc5 /lib | |
parent | efd378814c1ee5d2a8d3535079999961b62baf4b (diff) | |
parent | da1dbb52e42fd1acb398a0f223e1630d777a8c3c (diff) | |
download | nextcloud-server-fc18d33ff8a8b21ab38cf4e865152a16c91dc784.tar.gz nextcloud-server-fc18d33ff8a8b21ab38cf4e865152a16c91dc784.zip |
Merge pull request #22895 from owncloud/cleanup_default_share_provider
Remove support for old shares in the default share provider
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Share20/DefaultShareProvider.php | 51 |
1 files changed, 3 insertions, 48 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index b91ac24d44f..f6171f87992 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']); @@ -792,30 +771,6 @@ class DefaultShareProvider implements IShareProvider { } /** - * Get the node with file $id for $user - * - * @param string $user The userId - * @param int $id - * @return \OCP\Files\File|\OCP\Files\Folder - * @throws InvalidShare - */ - private function getNode($user, $id) { - try { - $userFolder = $this->rootFolder->getUserFolder($user); - } catch (NotFoundException $e) { - throw new InvalidShare(); - } - - $nodes = $userFolder->getById($id); - - if (empty($nodes)) { - throw new InvalidShare(); - } - - return $nodes[0]; - } - - /** * Resolve a group share to a user specific share * Thus if the user moved their group share make sure this is properly reflected here. * |