Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
introduce a function to get all recipients of a shared file
  • Loading branch information
Björn Schießle committed Nov 7, 2012
commit 6a948441a01ee2d6fb131e20b34d7e6a04ff8420
3 changes: 3 additions & 0 deletions lib/connector/sabre/node.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ static public function removeETagPropertyForPath($path) {
$source = self::getFileSource($path);
$path = $source['path'];

// get all user to which the file is shared
//OCP\Share::getItemShared($itemType, $itemSource)

$paths = array();
while ($path != '/' && $path != '.' && $path != '' && $path != '\\') {
$paths[] = $path;
Expand Down
24 changes: 24 additions & 0 deletions lib/public/share.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,31 @@ public static function isEnabled() {
}
return false;
}


/**
* @brief Get the item of item type shared with the current user by source
* @param string Item type
* @param string Item source
* @param string uid of item owner
* @param int Format (optional) Format type must be defined by the backend
* @return Return depends on format
*/
public static function getRecipientOfItemBySource($itemType, $itemSource, $itemOwner, $format = self::FORMAT_NONE, $parameters = null, $includeCollections = false) {
return self::getItems($itemType, $itemSource, self::$shareTypeUserAndGroups, null, $itemOwner, $format, $parameters, 1, $includeCollections, true);
}

/**
* @brief Get the items of item type shared with the current user
* @param string Item type
* @param int Format (optional) Format type must be defined by the backend
* @param int Number of items to return (optional) Returns all by default
* @return Return depends on format
*/
public static function getRecipientsOfItem($itemType, $itemSource, $format = self::FORMAT_NONE, $parameters = null, $limit = -1, $includeCollections = false) {
return self::getItems($itemType, null, self::$shareTypeUserAndGroups, \OC_User::getUser(), null, $format, $parameters, $limit, $includeCollections);
}

/**
* @brief Get the items of item type shared with the current user
* @param string Item type
Expand Down