summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-07-08 02:27:21 -0700
committerThomas Müller <thomas.mueller@tmit.eu>2013-07-08 02:27:21 -0700
commit0365d244e0b41785d7853f43d6b60017e9983cae (patch)
treef29b0f9f45e70f33c2362557f2cd135d7f271cb2 /lib
parent9b9ea7cd8e9050bd3682c1edd81955469bc8474d (diff)
parentc956a08d2219d623af4ceca644411c8217fe0cbf (diff)
downloadnextcloud-server-0365d244e0b41785d7853f43d6b60017e9983cae.tar.gz
nextcloud-server-0365d244e0b41785d7853f43d6b60017e9983cae.zip
Merge pull request #3946 from owncloud/fixing-3942-master
handle anonymous upload to reshared folder
Diffstat (limited to 'lib')
-rw-r--r--lib/public/share.php34
1 files changed, 23 insertions, 11 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index 28878c2c868..7ae0ffe0bfd 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -292,6 +292,29 @@ class Share {
}
/**
+ * @brief resolves reshares down to the last real share
+ * @param $linkItem
+ * @return $fileOwner
+ */
+ public static function resolveReShare($linkItem)
+ {
+ if (isset($linkItem['parent'])) {
+ $parent = $linkItem['parent'];
+ while (isset($parent)) {
+ $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*share` WHERE `id` = ?', 1);
+ $item = $query->execute(array($parent))->fetchRow();
+ if (isset($item['parent'])) {
+ $parent = $item['parent'];
+ } else {
+ return $item;
+ }
+ }
+ }
+ return $linkItem;
+ }
+
+
+ /**
* @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
@@ -318,17 +341,6 @@ class Share {
}
/**
- * @param $itemType
- * @param $itemSource
- * @param $uid_owner
- * @return mixed
- */
- public static function getSharedItem($itemType, $itemSource, $uid_owner) {
- return self::getItems($itemType, $itemSource, null, null, $uid_owner, self::FORMAT_NONE,
- null, 1, false);
- }
-
- /**
* Get all users an item is shared with
* @param string Item type
* @param string Item source