diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2012-10-15 20:11:22 +0400 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2012-10-15 20:16:27 +0400 |
commit | 5708488b3e3a2e8c60ac6fe32724f36428c2abff (patch) | |
tree | 7a406070d0cadc8bf48a5cde38df304e35153eb3 /apps | |
parent | 9aa9110fd906bc9191adbb129bf421ede77ccad7 (diff) |
make files_versions use OC_User::getHome, fixes 'PHP Warning: Missing argument 1 for OC_FilesystemView::getAbsolutePath' with custom user home dirs
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_versions/lib/versions.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 076094ae781..1b3de84f31a 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -58,8 +58,9 @@ class Storage { public function store($filename) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { list($uid, $filename) = self::getUidAndFilename($filename); - $files_view = new \OC_FilesystemView('/'.$uid.'/files'); - $users_view = new \OC_FilesystemView('/'.$uid); + $userHome = \OC_User::getHome($uid); + $files_view = new \OC_FilesystemView($userHome.'/files'); + $users_view = new \OC_FilesystemView($userHome); //check if source file already exist as version to avoid recursions. // todo does this check work? @@ -94,7 +95,7 @@ class Storage { // check mininterval if the file is being modified by the owner (all shared files should be versioned despite mininterval) if ($uid == \OCP\User::getUser()) { - $versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions'); + $versions_fileview = new \OC_FilesystemView($userHome.'/files_versions'); $versionsFolderName=\OCP\Config::getSystemValue('datadirectory'). $versions_fileview->getAbsolutePath(''); $matches=glob($versionsFolderName.'/'.$filename.'.v*'); sort($matches); @@ -127,7 +128,7 @@ class Storage { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { list($uid, $filename) = self::getUidAndFilename($filename); - $users_view = new \OC_FilesystemView('/'.$uid); + $users_view = new \OC_FilesystemView(\OC_User::getHome($uid)); // rollback if( @$users_view->copy('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) { @@ -150,7 +151,7 @@ class Storage { public static function isversioned($filename) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { list($uid, $filename) = self::getUidAndFilename($filename); - $versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions'); + $versions_fileview = new \OC_FilesystemView(\OC_User::getHome($uid).'/files_versions'); $versionsFolderName=\OCP\Config::getSystemValue('datadirectory'). $versions_fileview->getAbsolutePath(''); @@ -178,7 +179,7 @@ class Storage { if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) { list($uid, $filename) = self::getUidAndFilename($filename); - $versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions'); + $versions_fileview = new \OC_FilesystemView(\OC_User::getHome($uid).'/files_versions'); $versionsFolderName = \OCP\Config::getSystemValue('datadirectory'). $versions_fileview->getAbsolutePath(''); $versions = array(); @@ -190,7 +191,7 @@ class Storage { $i = 0; - $files_view = new \OC_FilesystemView('/'.$uid.'/files'); + $files_view = new \OC_FilesystemView(\OC_User::getHome($uid).'/files'); $local_file = $files_view->getLocalFile($filename); foreach( $matches as $ma ) { |