summaryrefslogtreecommitdiffstats
path: root/lib/public/share.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/share.php')
-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