Merge pull request #1192 from schiesbn/versioning_history_issue_1189

fix for issue #1186, missing variables added
remotes/origin/stable5
Björn Schießle 12 years ago
commit 2b9c925a2b
  1. 3
      apps/files_versions/lib/versions.php

@ -79,6 +79,7 @@ class Storage {
// create all parent folders // create all parent folders
$info=pathinfo($filename); $info=pathinfo($filename);
$versionsFolderName=\OCP\Config::getSystemValue('datadirectory').$users_view->getAbsolutePath('files_versions/');
if(!file_exists($versionsFolderName.'/'.$info['dirname'])) { if(!file_exists($versionsFolderName.'/'.$info['dirname'])) {
mkdir($versionsFolderName.'/'.$info['dirname'], 0750, true); mkdir($versionsFolderName.'/'.$info['dirname'], 0750, true);
} }
@ -128,6 +129,7 @@ class Storage {
list($uidn, $newpath) = self::getUidAndFilename($newpath); list($uidn, $newpath) = self::getUidAndFilename($newpath);
$versions_view = new \OC_FilesystemView('/'.$uid .'/files_versions'); $versions_view = new \OC_FilesystemView('/'.$uid .'/files_versions');
$files_view = new \OC_FilesystemView('/'.$uid .'/files'); $files_view = new \OC_FilesystemView('/'.$uid .'/files');
$abs_newpath = \OCP\Config::getSystemValue('datadirectory').$versions_view->getAbsolutePath('').$newpath;
if ( $files_view->is_dir($oldpath) && $versions_view->is_dir($oldpath) ) { if ( $files_view->is_dir($oldpath) && $versions_view->is_dir($oldpath) ) {
$versions_view->rename($oldpath, $newpath); $versions_view->rename($oldpath, $newpath);
@ -149,6 +151,7 @@ class Storage {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
list($uid, $filename) = self::getUidAndFilename($filename); list($uid, $filename) = self::getUidAndFilename($filename);
$users_view = new \OC_FilesystemView('/'.$uid); $users_view = new \OC_FilesystemView('/'.$uid);
$versionCreated = false;
//first create a new version //first create a new version
$version = 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename); $version = 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename);

Loading…
Cancel
Save