summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-11-24 15:31:52 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2014-12-04 13:18:13 +0100
commit698ecbf308d1eae950138bff9edbb0d542c391d0 (patch)
tree3f6ab525053f56c01f2fcef4792a9756f882ab7d /lib/private
parentf0e6876f2ec8ec4576ca0ce8bbfee5bd8082dc1f (diff)
downloadnextcloud-server-698ecbf308d1eae950138bff9edbb0d542c391d0.tar.gz
nextcloud-server-698ecbf308d1eae950138bff9edbb0d542c391d0.zip
OCS API for server-to-server sharing
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/share/share.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index c6fd1604ac7..abcd14f6ec2 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -699,18 +699,19 @@ class Share extends \OC\Share\Constants {
* @param string $itemSource
* @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
* @param string $shareWith User or group the item is being shared with
+ * @param string $owner owner of the share, if null the current user is used
* @return boolean true on success or false on failure
*/
- public static function unshare($itemType, $itemSource, $shareType, $shareWith) {
+ public static function unshare($itemType, $itemSource, $shareType, $shareWith, $owner = null) {
// check if it is a valid itemType
self::getBackend($itemType);
- $items = self::getItemSharedWithUser($itemType, $itemSource, $shareWith, null, $shareType);
+ $items = self::getItemSharedWithUser($itemType, $itemSource, $shareWith, $owner, $shareType);
$toDelete = array();
$newParent = null;
- $currentUser = \OC_User::getUser();
+ $currentUser = $owner ? $owner : \OC_User::getUser();
foreach ($items as $item) {
// delete the item with the expected share_type and owner
if ((int)$item['share_type'] === (int)$shareType && $item['uid_owner'] === $currentUser) {