Browse Source

fix getVersions(), we need to get the correct user and filename

tags/v5.0.0beta2
Björn Schießle 11 years ago
parent
commit
0a5457c550
2 changed files with 3 additions and 3 deletions
  1. 2
    2
      apps/files_versions/ajax/getVersions.php
  2. 1
    1
      apps/files_versions/lib/versions.php

+ 2
- 2
apps/files_versions/ajax/getVersions.php View 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();


+ 1
- 1
apps/files_versions/lib/versions.php View 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);

Loading…
Cancel
Save