summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-05-08 15:05:03 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-05-08 22:59:49 +0200
commitb9134dcd6a997f252db8498dec7b422e148a5681 (patch)
tree3d67d200e7d503c5dc6a9dffd043a8b845bf282b /apps/files_versions
parente8a80c6c2fac222ddd4dd40de5ab8bab5cef9fec (diff)
downloadnextcloud-server-b9134dcd6a997f252db8498dec7b422e148a5681.tar.gz
nextcloud-server-b9134dcd6a997f252db8498dec7b422e148a5681.zip
touch file relative to users file folder, otherwise the hooks will be ignored
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/lib/versions.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index c38ba688fe0..836e3914dc0 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -184,11 +184,12 @@ class Storage {
/**
* rollback to an old version of a file.
*/
- public static function rollback($filename, $revision) {
+ public static function rollback($file, $revision) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
- list($uid, $filename) = self::getUidAndFilename($filename);
+ list($uid, $filename) = self::getUidAndFilename($file);
$users_view = new \OC\Files\View('/'.$uid);
+ $files_view = new \OC\Files\View('/'.\OCP\User::getUser().'/files');
$versionCreated = false;
//first create a new version
@@ -200,8 +201,8 @@ class Storage {
// rollback
if( @$users_view->copy('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) {
- $users_view->touch('files'.$filename, $revision);
- Storage::expire($filename);
+ $files_view->touch($file, $revision);
+ Storage::expire($file);
return true;
}else if ( $versionCreated ) {