Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
3b1dde70
Commit
3b1dde70
authored
9 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
dont go trough the view when renaming/copying on shared storages
parent
d4eff553
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/files_sharing/lib/sharedstorage.php
+21
-20
21 additions, 20 deletions
apps/files_sharing/lib/sharedstorage.php
with
21 additions
and
20 deletions
apps/files_sharing/lib/sharedstorage.php
+
21
−
20
View file @
3b1dde70
...
...
@@ -31,7 +31,6 @@ namespace OC\Files\Storage;
use
OC\Files\Cache\ChangePropagator
;
use
OC\Files\Filesystem
;
use
OC\Files\View
;
use
OCA\Files_Sharing
\ISharedStorage
;
use
OCA\Files_Sharing
\Propagator
;
use
OCA\Files_Sharing
\SharedMount
;
...
...
@@ -327,30 +326,32 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
}
}
// for part files we need to ask for the owner and path from the parent directory because
// the file cache doesn't return any results for part files
if
(
$isPartFile
)
{
list
(
$user1
,
$path1
)
=
\OCA\Files_Sharing\Helper
::
getUidAndFilename
(
$pathinfo
[
'dirname'
]);
$path1
=
$path1
.
'/'
.
$pathinfo
[
'basename'
];
}
else
{
list
(
$user1
,
$path1
)
=
\OCA\Files_Sharing\Helper
::
getUidAndFilename
(
$relPath1
);
}
$targetFilename
=
basename
(
$relPath2
);
list
(
$user2
,
$path2
)
=
\OCA\Files_Sharing\Helper
::
getUidAndFilename
(
dirname
(
$relPath2
));
$rootView
=
new
\OC\Files\View
(
''
);
$rootView
->
getUpdater
()
->
disable
();
// dont update the cache here
$result
=
$rootView
->
rename
(
'/'
.
$user1
.
'/files/'
.
$path1
,
'/'
.
$user2
.
'/files/'
.
$path2
.
'/'
.
$targetFilename
);
$rootView
->
getUpdater
()
->
enable
();
return
$result
;
/**
* @var \OC\Files\Storage\Storage $sourceStorage
*/
list
(
$sourceStorage
,
$sourceInternalPath
)
=
$this
->
resolvePath
(
$path1
);
/**
* @var \OC\Files\Storage\Storage $targetStorage
*/
list
(
$targetStorage
,
$targetInternalPath
)
=
$this
->
resolvePath
(
$path2
);
return
$targetStorage
->
moveFromStorage
(
$sourceStorage
,
$sourceInternalPath
,
$targetInternalPath
);
}
public
function
copy
(
$path1
,
$path2
)
{
// Copy the file if CREATE permission is granted
if
(
$this
->
isCreatable
(
dirname
(
$path2
)))
{
$oldSource
=
$this
->
getSourcePath
(
$path1
);
$newSource
=
$this
->
getSourcePath
(
dirname
(
$path2
))
.
'/'
.
basename
(
$path2
);
$rootView
=
new
\OC\Files\View
(
''
);
return
$rootView
->
copy
(
$oldSource
,
$newSource
);
/**
* @var \OC\Files\Storage\Storage $sourceStorage
*/
list
(
$sourceStorage
,
$sourceInternalPath
)
=
$this
->
resolvePath
(
$path1
);
/**
* @var \OC\Files\Storage\Storage $targetStorage
*/
list
(
$targetStorage
,
$targetInternalPath
)
=
$this
->
resolvePath
(
$path2
);
return
$targetStorage
->
copyFromStorage
(
$sourceStorage
,
$sourceInternalPath
,
$targetInternalPath
);
}
return
false
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment