summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-03-03 17:24:31 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2014-03-25 17:47:24 +0100
commit078fafdc5ace1981a9e5582ac66cc087a1277aed (patch)
tree00c7f1d21c054d8140a6a798674e90cd81cdb867 /lib
parent3a459db3585f02d02c492dc3ce836e2fea1c8cb2 (diff)
downloadnextcloud-server-078fafdc5ace1981a9e5582ac66cc087a1277aed.tar.gz
nextcloud-server-078fafdc5ace1981a9e5582ac66cc087a1277aed.zip
use variable
Diffstat (limited to 'lib')
-rw-r--r--lib/private/share/share.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 45ed4c70458..48dd3cd68ea 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -973,13 +973,13 @@ class Share extends \OC\Share\Constants {
$where .= ' AND `share_type` != ?';
$queryArgs[] = self::$shareTypeGroupUserUnique;
}
- if ($itemType == 'file' || $itemType == 'folder') {
+ if ($fileDependent) {
$column = 'file_source';
} else {
$column = 'item_source';
}
} else {
- if ($itemType == 'file' || $itemType == 'folder') {
+ if ($fileDependent) {
$column = 'file_target';
} else {
$column = 'item_target';
@@ -994,7 +994,7 @@ class Share extends \OC\Share\Constants {
// If looking for own shared items, check item_source else check item_target
if (isset($uidOwner) || $itemShareWithBySource) {
// If item type is a file, file source needs to be checked in case the item was converted
- if ($itemType == 'file' || $itemType == 'folder') {
+ if ($fileDependent) {
$where .= ' `file_source` = ?';
$column = 'file_source';
} else {
@@ -1002,7 +1002,7 @@ class Share extends \OC\Share\Constants {
$column = 'item_source';
}
} else {
- if ($itemType == 'file' || $itemType == 'folder') {
+ if ($fileDependent) {
$where .= ' `file_target` = ?';
$item = \OC\Files\Filesystem::normalizePath($item);
} else {
@@ -1225,7 +1225,7 @@ class Share extends \OC\Share\Constants {
} else if (!isset($statuses[$item[$column]])) {
$statuses[$item[$column]]['link'] = false;
}
- if ($itemType == 'file' || $itemType == 'folder') {
+ if ($fileDependent) {
$statuses[$item[$column]]['path'] = $item['path'];
}
}
@@ -1296,7 +1296,6 @@ class Share extends \OC\Share\Constants {
\OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
throw new \Exception($message);
}
- $parent = null;
if ($backend instanceof \OCP\Share_Backend_File_Dependent) {
$filePath = $backend->getFilePath($itemSource, $uidOwner);
if ($itemType == 'file' || $itemType == 'folder') {