summaryrefslogtreecommitdiffstats
path: root/lib/private/share
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-11-17 18:05:12 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2014-11-18 11:11:49 +0100
commit367468ff1f7cedf213e9a82a988026e3d4c53966 (patch)
treeb1c1970e239f697207a4e6ced9e0752ac2173ca1 /lib/private/share
parent5192641447e0961111fe361666685f4d0dacbbb4 (diff)
downloadnextcloud-server-367468ff1f7cedf213e9a82a988026e3d4c53966.tar.gz
nextcloud-server-367468ff1f7cedf213e9a82a988026e3d4c53966.zip
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.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index f9d1de1febf..ddacac098c1 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);
@@ -697,7 +703,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;