diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-08 20:56:55 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-08 20:56:55 -0400 |
commit | 2c5744f16c82f4f6742ad528c88b0480d007a014 (patch) | |
tree | 098d2f49e2ccec78db05e36b009248d4c39fb545 /lib/public | |
parent | f4285a25ef5e41ab02c8d34f6d69a0c2553e267f (diff) | |
download | nextcloud-server-2c5744f16c82f4f6742ad528c88b0480d007a014.tar.gz nextcloud-server-2c5744f16c82f4f6742ad528c88b0480d007a014.zip |
Add back getItemSharedWithBySource(), some situtations require this ability
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/share.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/public/share.php b/lib/public/share.php index 0a5c4ce7793..113f55a3480 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -99,6 +99,17 @@ class Share { } /** + * @brief Get the item of item type shared with the current user by source + * @param string Item type + * @param string Item source + * @param int Format (optional) Format type must be defined by the backend + * @return Return depends on format + */ + public static function getItemSharedWithBySource($itemType, $itemSource, $format = self::FORMAT_NONE, $parameters = null, $includeCollections = false) { + return self::getItems($itemType, $itemSource, self::$shareTypeUserAndGroups, \OC_User::getUser(), null, $format, $parameters, 1, $includeCollections, true); + } + + /** * @brief Get the shared items of item type owned by the current user * @param string Item type * @param int Format (optional) Format type must be defined by the backend @@ -434,7 +445,7 @@ class Share { * See public functions getItem(s)... for parameter usage * */ - private static function getItems($itemType, $item = null, $shareType = null, $shareWith = null, $uidOwner = null, $format = self::FORMAT_NONE, $parameters = null, $limit = -1, $includeCollections = false) { + private static function getItems($itemType, $item = null, $shareType = null, $shareWith = null, $uidOwner = null, $format = self::FORMAT_NONE, $parameters = null, $limit = -1, $includeCollections = false, $itemShareWithBySource = false) { $backend = self::getBackend($itemType); // Get filesystem root to add it to the file target and remove from the file source $root = \OC_Filesystem::getRoot(); @@ -489,7 +500,7 @@ class Share { } if (isset($item)) { // If looking for own shared items, check item_source else check item_target - if (isset($uidOwner)) { + if (isset($uidOwner) || $itemShareWithBySource) { // If item type is a file, file source needs to be checked in case the item was converted if ($itemType == 'file' || $itemType == 'folder') { $where .= " AND path = ?"; |