aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-02-21 14:40:16 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-02-21 14:40:16 +0100
commit0a5457c5506730bf75a319b74a5bc97169da36d3 (patch)
treedb6f441872dd5420bc57f978808e851ec5ceed13
parentc8c0e72e730330f7f066137c2045572a5349ec7e (diff)
downloadnextcloud-server-0a5457c5506730bf75a319b74a5bc97169da36d3.tar.gz
nextcloud-server-0a5457c5506730bf75a319b74a5bc97169da36d3.zip
fix getVersions(), we need to get the correct user and filename
-rw-r--r--apps/files_versions/ajax/getVersions.php4
-rw-r--r--apps/files_versions/lib/versions.php2
2 files changed, 3 insertions, 3 deletions
diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php
index 53fc04625c6..8a8fa43080c 100644
--- a/apps/files_versions/ajax/getVersions.php
+++ b/apps/files_versions/ajax/getVersions.php
@@ -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();
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index ba9f8ba41cb..ff55549c143 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -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);