]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix getVersions(), we need to get the correct user and filename
authorBjörn Schießle <schiessle@owncloud.com>
Thu, 21 Feb 2013 13:40:16 +0000 (14:40 +0100)
committerBjörn Schießle <schiessle@owncloud.com>
Thu, 21 Feb 2013 13:40:16 +0000 (14:40 +0100)
apps/files_versions/ajax/getVersions.php
apps/files_versions/lib/versions.php

index 53fc04625c652ebaf27289b8a5c73ddbfa53399c..8a8fa43080ca4cea0fe6a723fca1d9ecbc7857cb 100644 (file)
@@ -1,11 +1,11 @@
 <?php
 OCP\JSON::checkAppEnabled('files_versions');
 
-$userDirectory = "/".OCP\USER::getUser()."/files";
 $source = $_GET['source'];
+list ($uid, $filename) = OCA\Files_Versions\Storage::getUidAndFilename($source);
 
 $count = 5; //show the newest revisions
-if( ($versions = OCA\Files_Versions\Storage::getVersions( $source, $count)) ) {
+if( ($versions = OCA\Files_Versions\Storage::getVersions($uid, $filename, $count)) ) {
 
        $versionsFormatted = array();
 
index ba9f8ba41cbedf70528f917565f5981318de4cb6..ff55549c143e8462744896027a1d15a403001c1f 100644 (file)
@@ -35,7 +35,7 @@ class Storage {
                                                                                                                                        'step' => 604800),
                        );      
 
-       private static function getUidAndFilename($filename) {
+       public static function getUidAndFilename($filename) {
                $uid = \OC\Files\Filesystem::getOwner($filename);
                if ( $uid != \OCP\User::getUser() ) {
                        $info = \OC\Files\Filesystem::getFileInfo($filename);