[Pkg-owncloud-commits] [owncloud] 94/104: Unshare all will now delete all shares for the item, instead of only for a single owner.
David Prévot
taffit at moszumanska.debian.org
Sat Jan 18 13:33:43 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 3093c63024434085f31ef355fef88ba91357a9f7
Author: ben-denham <bend at catalyst.net.nz>
Date: Mon Jan 6 11:14:43 2014 +1300
Unshare all will now delete all shares for the item, instead of only for a single owner.
---
lib/public/share.php | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/public/share.php b/lib/public/share.php
index f0fd8e1..eb1dd8d 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,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list