|
|
|
|
@ -206,27 +206,15 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param string $target
|
|
|
|
|
* @param string $mountPoint
|
|
|
|
|
* @param string $itemType
|
|
|
|
|
* @param array $share
|
|
|
|
|
* @return array|false source item
|
|
|
|
|
*/
|
|
|
|
|
public static function getSource($target, $mountPoint, $itemType) {
|
|
|
|
|
if ($itemType === 'folder') {
|
|
|
|
|
$source = \OCP\Share::getItemSharedWith('folder', $mountPoint, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE);
|
|
|
|
|
if ($source && $target !== '') {
|
|
|
|
|
// note: in case of ext storage mount points the path might be empty
|
|
|
|
|
// which would cause a leading slash to appear
|
|
|
|
|
$source['path'] = ltrim($source['path'] . '/' . $target, '/');
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$source = \OCP\Share::getItemSharedWith('file', $mountPoint, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE);
|
|
|
|
|
}
|
|
|
|
|
if ($source) {
|
|
|
|
|
return self::resolveReshares($source);
|
|
|
|
|
public static function getSource($target, $share) {
|
|
|
|
|
if ($share['item_type'] === 'folder' && $target !== '') {
|
|
|
|
|
// note: in case of ext storage mount points the path might be empty
|
|
|
|
|
// which would cause a leading slash to appear
|
|
|
|
|
$share['path'] = ltrim($share['path'] . '/' . $target, '/');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
\OCP\Util::writeLog('files_sharing', 'File source not found for: '.$target, \OCP\Util::DEBUG);
|
|
|
|
|
return false;
|
|
|
|
|
return self::resolveReshares($share);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|