[Pkg-owncloud-commits] [owncloud] 06/58: Correctly select file cache values also when checking group shares
David Prévot
taffit at moszumanska.debian.org
Tue Aug 11 15:58:03 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v8.0.6
in repository owncloud.
commit 5b1b84486785e3021b6e7e1823c037acbd63e4cc
Author: Joas Schilling <nickvergessen at owncloud.com>
Date: Wed Apr 29 14:12:12 2015 +0200
Correctly select file cache values also when checking group shares
---
lib/private/share/share.php | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 7c98d87..e1eabc6 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -318,15 +318,15 @@ class Share extends \OC\Share\Constants {
$shares = array();
$fileDependent = false;
+ $where = 'WHERE';
+ $fileDependentWhere = '';
if ($itemType === 'file' || $itemType === 'folder') {
$fileDependent = true;
$column = 'file_source';
- $where = 'INNER JOIN `*PREFIX*filecache` ON `file_source` = `*PREFIX*filecache`.`fileid` ';
- $where .= 'INNER JOIN `*PREFIX*storages` ON `numeric_id` = `*PREFIX*filecache`.`storage` ';
- $where .= ' WHERE';
+ $fileDependentWhere = 'INNER JOIN `*PREFIX*filecache` ON `file_source` = `*PREFIX*filecache`.`fileid` ';
+ $fileDependentWhere .= 'INNER JOIN `*PREFIX*storages` ON `numeric_id` = `*PREFIX*filecache`.`storage` ';
} else {
$column = 'item_source';
- $where = 'WHERE';
}
$select = self::createSelectStatement(self::FORMAT_NONE, $fileDependent);
@@ -349,7 +349,7 @@ class Share extends \OC\Share\Constants {
$arguments[] = $owner;
}
- $query = \OC_DB::prepare('SELECT ' . $select . ' FROM `*PREFIX*share` '. $where);
+ $query = \OC_DB::prepare('SELECT ' . $select . ' FROM `*PREFIX*share` '. $fileDependentWhere . $where);
$result = \OC_DB::executeAudited($query, $arguments);
@@ -365,7 +365,7 @@ class Share extends \OC\Share\Constants {
$groups = \OC_Group::getUserGroups($user);
if (!empty($groups)) {
- $where = 'WHERE `' . $column . '` = ? AND `item_type` = ? AND `share_with` in (?)';
+ $where = $fileDependentWhere . ' WHERE `' . $column . '` = ? AND `item_type` = ? AND `share_with` in (?)';
$arguments = array($itemSource, $itemType, $groups);
$types = array(null, null, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY);
@@ -379,7 +379,7 @@ class Share extends \OC\Share\Constants {
// class isn't static anymore...
$conn = \OC_DB::getConnection();
$result = $conn->executeQuery(
- 'SELECT * FROM `*PREFIX*share` ' . $where,
+ 'SELECT ' . $select . ' FROM `*PREFIX*share` ' . $where,
$arguments,
$types
);
--
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