diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-11-17 20:05:12 +0300 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-11-18 19:27:10 +0300 |
commit | fcde4c70a26c0149ca1c62958bae11e2cbec35ee (patch) | |
tree | be4a37a9b27f42c625b105dcf787665053f781d2 /lib/private/share | |
parent | b7cf8fac34965a7c7c54eacdcd8ec62c4df221c4 (diff) |
make sure that we only find the shares from the correct share type if users and groups with the same ID exists
Diffstat (limited to 'lib/private/share')
-rw-r--r-- | lib/private/share/share.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php index c5f3bf69b31..07c2641644d 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -288,9 +288,10 @@ class Share extends \OC\Share\Constants { * @param string $itemType * @param string $itemSource * @param string $user User user to whom the item was shared + * @param int $shareType only look for a specific share type * @return array Return list of items with file_target, permissions and expiration */ - public static function getItemSharedWithUser($itemType, $itemSource, $user) { + public static function getItemSharedWithUser($itemType, $itemSource, $user, $shareType = null) { $shares = array(); $fileDependend = false; @@ -314,6 +315,11 @@ class Share extends \OC\Share\Constants { $arguments[] = $user; } + if ($shareType !== null) { + $where .= ' AND `share_type` = ? '; + $arguments[] = $shareType; + } + $query = \OC_DB::prepare('SELECT ' . $select . ' FROM `*PREFIX*share` '. $where); $result = \OC_DB::executeAudited($query, $arguments); @@ -695,7 +701,7 @@ class Share extends \OC\Share\Constants { // check if it is a valid itemType self::getBackend($itemType); - $items = self::getItemSharedWithUser($itemType, $itemSource, $shareWith); + $items = self::getItemSharedWithUser($itemType, $itemSource, $shareWith, $shareType); $toDelete = array(); $newParent = null; |