summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2014-01-16 03:13:26 -0800
committerBjörn Schießle <schiessle@owncloud.com>2014-01-16 03:13:26 -0800
commit32e941a2bcac425c4733edc9dc44197e358b7d13 (patch)
tree70282dcf947883fc18177e72d278c2dc14b2e507 /lib
parentbd643c47f32ba6d7b3ba6a18ed1591aab0b81be8 (diff)
parent30f77f53d5c97e369a879eab9381b856a5caf79c (diff)
downloadnextcloud-server-32e941a2bcac425c4733edc9dc44197e358b7d13.tar.gz
nextcloud-server-32e941a2bcac425c4733edc9dc44197e358b7d13.zip
Merge pull request #6644 from ben-denham/unshare-all-fix
\OCP\Share::unshareAll() fix
Diffstat (limited to 'lib')
-rw-r--r--lib/public/share.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index f0fd8e1ab1b..eb1dd8d1c95 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -655,7 +655,15 @@ class Share {
* @return Returns true on success or false on failure
*/
public static function unshareAll($itemType, $itemSource) {
- if ($shares = self::getItemShared($itemType, $itemSource)) {
+ // Get all of the owners of shares of this item.
+ $query = \OC_DB::prepare( 'SELECT `uid_owner` from `*PREFIX*share` WHERE `item_type`=? AND `item_source`=?' );
+ $result = $query->execute(array($itemType, $itemSource));
+ $shares = array();
+ // Add each owner's shares to the array of all shares for this item.
+ while ($row = $result->fetchRow()) {
+ $shares = array_merge($shares, self::getItems($itemType, $itemSource, null, null, $row['uid_owner']));
+ }
+ if (!empty($shares)) {
// Pass all the vars we have for now, they may be useful
$hookParams = array(
'itemType' => $itemType,