summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2012-07-05 14:20:40 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2012-07-05 14:20:40 +0200
commit51774cca6b34a24ccbc191184f6d36d81b879210 (patch)
treeea78b31af4e12e1a8bf6f8917cbc30152a64e3ad /apps/files_versions
parent378fa2bc86fd5df095b2d05855bd54a341dba1b0 (diff)
downloadnextcloud-server-51774cca6b34a24ccbc191184f6d36d81b879210.tar.gz
nextcloud-server-51774cca6b34a24ccbc191184f6d36d81b879210.zip
use OC_Filesystem for rollback
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/lib/versions.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 412044dba7d..5611e538ad8 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -147,6 +147,9 @@ class Storage {
public static function rollback($filename,$revision) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ $users_view = \OCP\Files::getStorage("files_versions");
+ $users_view->chroot(\OCP\User::getUser().'/');
+
if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) {
$pos = strpos($source, '/files', 1);
$uid = substr($source, 1, $pos - 1);
@@ -159,7 +162,7 @@ class Storage {
$filesfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. $uid .'/files';
// rollback
- if ( @copy($versionsFolderName.'/'.$filename.'.v'.$revision,$filesfoldername.'/'.$filename) ) {
+ if( @$users_view->copy('versions'.$filename.'.v'.$revision, 'files'.$filename) ) {
return true;