From e20db42a0c51fd7f7d028852ef60d47dd71e4adc Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 29 Apr 2020 20:40:45 +0200 Subject: Tags.php and the old sharing mechanism The old sharing mechanism isn't working anymore, because it was replaced by Share 2.0. Also it was nowhere used so this removes the code paths and reduces complexity. Signed-off-by: Morris Jobke --- lib/private/Share/Share.php | 54 --------------------------------------------- 1 file changed, 54 deletions(-) (limited to 'lib/private/Share/Share.php') diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index c624f243123..b37d167d896 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -520,60 +520,6 @@ class Share extends Constants { return false; } - /** - * Get the owners of items shared with a user. - * - * @param string $user The user the items are shared with. - * @param string $type The type of the items shared with the user. - * @param boolean $includeCollections Include collection item types (optional) - * @param boolean $includeOwner include owner in the list of users the item is shared with (optional) - * @return array - * @deprecated TESTS ONLY - this methods is only used by tests - * called like this: - * \OC\Share\Share::getSharedItemsOwners($this->user, $this->type, true) - */ - public static function getSharedItemsOwners($user, $type, $includeCollections = false, $includeOwner = false) { - // First, we find out if $type is part of a collection (and if that collection is part of - // another one and so on). - $collectionTypes = []; - if (!$includeCollections || !$collectionTypes = self::getCollectionItemTypes($type)) { - $collectionTypes[] = $type; - } - - // Of these collection types, along with our original $type, we make a - // list of the ones for which a sharing backend has been registered. - // FIXME: Ideally, we wouldn't need to nest getItemsSharedWith in this loop but just call it - // with its $includeCollections parameter set to true. Unfortunately, this fails currently. - $allMaybeSharedItems = []; - foreach ($collectionTypes as $collectionType) { - if (isset(self::$backends[$collectionType])) { - $allMaybeSharedItems[$collectionType] = self::getItemsSharedWithUser( - $collectionType, - $user, - self::FORMAT_NONE - ); - } - } - - $owners = []; - if ($includeOwner) { - $owners[] = $user; - } - - // We take a look at all shared items of the given $type (or of the collections it is part of) - // and find out their owners. Then, we gather the tags for the original $type from all owners, - // and return them as elements of a list that look like "Tag (owner)". - foreach ($allMaybeSharedItems as $collectionType => $maybeSharedItems) { - foreach ($maybeSharedItems as $sharedItem) { - if (isset($sharedItem['id'])) { //workaround for https://github.com/owncloud/core/issues/2814 - $owners[] = $sharedItem['uid_owner']; - } - } - } - - return $owners; - } - /** * Get shared items from the database * @param string $itemType -- cgit v1.2.3