summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-02-25 04:59:47 -0800
committerBernhard Posselt <nukeawhale@gmail.com>2013-02-25 04:59:47 -0800
commit3f48bebe924062cc01abc8c72019235a00f38b76 (patch)
tree1375e1deee04cf0847e7d7ea6d7212e08b8b0b9a /apps/files_versions
parent660670ec68bb4f4d4162e97e9a5cec90fd765118 (diff)
parent0a5457c5506730bf75a319b74a5bc97169da36d3 (diff)
downloadnextcloud-server-3f48bebe924062cc01abc8c72019235a00f38b76.tar.gz
nextcloud-server-3f48bebe924062cc01abc8c72019235a00f38b76.zip
Merge pull request #1827 from owncloud/fix_getVersions
fix getVersions(), we need to get the correct user and filename
Diffstat (limited to 'apps/files_versions')
-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 adbf2c1df7e..abc5870a485 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -35,7 +35,7 @@ class Storage {
6 => array('intervalEndsAfter' => -1, 'step' => 604800),
);
- private static function getUidAndFilename($filename) {
+ public static function getUidAndFilename($filename) {
$uid = \OC\Files\Filesystem::getOwner($filename);
\OC\Files\Filesystem::initMountPoints($uid);
if ( $uid != \OCP\User::getUser() ) {