summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2012-10-02 18:59:20 +0200
committerBjörn Schießle <schiessle@owncloud.com>2012-10-02 18:59:20 +0200
commitdb954f5aba94318280953fdd8a1af087680c1e2b (patch)
tree2f8bc2accaa32288ef21e4e4b1afc4d7f4f6a35a
parent92b37119e36a6c7d418e56d7c6d73fd4625210b7 (diff)
downloadnextcloud-server-db954f5aba94318280953fdd8a1af087680c1e2b.tar.gz
nextcloud-server-db954f5aba94318280953fdd8a1af087680c1e2b.zip
remove unnecessary code and add missing items to select statement
-rw-r--r--lib/public/share.php16
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index 61b1a571d84..2f06dcb8641 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -1002,19 +1002,7 @@ class Share {
}
}
// Check if target already exists
- $checkTarget = array();
- if( $itemType == "file" or $itemType == "folder") {
- $itemList1 = self::getItems("file", $target, $shareType, $shareWith);
- $itemList2 = self::getItems("folder", $target, $shareType, $shareWith);
- if ( !empty($itemList1) ) {
- $checkTarget = array_merge($checkTarget, $itemList1);
- }
- if ( !empty($itemList2) ) {
- $checkTarget = array_merge($checkTarget, $itemList2);
- }
- } else {
- $checkTarget = self::getItems($itemType, $target, $shareType, $shareWith);
- }
+ $checkTarget = self::getItems($itemType, $target, $shareType, $shareWith);
if ( !empty($checkTarget) ) {
foreach ($checkTarget as $item) {
@@ -1074,7 +1062,7 @@ class Share {
$parents = "'".implode("','", $parents)."'";
// Check the owner on the first search of reshares, useful for finding and deleting the reshares by a single user of a group share
if (count($ids) == 1 && isset($uidOwner)) {
- $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*share` WHERE `parent` IN ('.$parents.') AND `uid_owner` = ?');
+ $query = \OC_DB::prepare('SELECT `id`, `uid_owner`, `item_type`, `item_target`, `parent` FROM `*PREFIX*share` WHERE `parent` IN ('.$parents.') AND `uid_owner` = ?');
$result = $query->execute(array($uidOwner));
} else {
$query = \OC_DB::prepare('SELECT `id`, `item_type`, `item_target`, `parent`, `uid_owner` FROM `*PREFIX*share` WHERE `parent` IN ('.$parents.')');