summaryrefslogtreecommitdiffstats
path: root/lib/private/Share20/DefaultShareProvider.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-03-07 10:40:49 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-03-23 07:58:17 +0100
commitb26b8d17ebcd843ddba35bf446f3f5a7655ee38d (patch)
treec97d047835f3af5def9a644dfa45261e5062a9ee /lib/private/Share20/DefaultShareProvider.php
parente6fb139eb911f397a2143296621228fa1f1601fc (diff)
downloadnextcloud-server-b26b8d17ebcd843ddba35bf446f3f5a7655ee38d.tar.gz
nextcloud-server-b26b8d17ebcd843ddba35bf446f3f5a7655ee38d.zip
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
Diffstat (limited to 'lib/private/Share20/DefaultShareProvider.php')
-rw-r--r--lib/private/Share20/DefaultShareProvider.php27
1 files changed, 3 insertions, 24 deletions
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']);