[Share 2.0] Make public link work without view

This commit is contained in:
Roeland Jago Douma 2016-01-19 10:17:29 +01:00
parent 8734ebe505
commit 894a88ca51
1 changed files with 13 additions and 2 deletions

View File

@ -248,9 +248,20 @@ class ShareController extends Controller {
// Show file list
if ($share->getPath() instanceof \OCP\Files\Folder) {
$shareTmpl['dir'] = $rootFolder->getRelativePath($path->getPath());
$maxUploadFilesize = Util::maxUploadFilesize($share->getPath()->getPath());
$freeSpace = Util::freeSpace($share->getPath()->getPath());
/*
* The OC_Util methods require a view. This just uses the node API
*/
$freeSpace = $share->getPath()->getStorage()->free_space($share->getPath()->getInternalPath());
if ($freeSpace !== \OCP\Files\FileInfo::SPACE_UNKNOWN) {
$freeSpace = max($freeSpace, 0);
} else {
$freeSpace = (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188
}
$uploadLimit = Util::uploadLimit();
$maxUploadFilesize = min($freeSpace, $uploadLimit);
$folder = new Template('files', 'list', '');
$folder->assign('dir', $rootFolder->getRelativePath($path->getPath()));
$folder->assign('dirToken', $token);