From c237a3f00340d807590f5b4df8e69738ed2fa2b9 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 18 Oct 2018 12:43:08 +0200 Subject: [PATCH] Expose hide download to public page Signed-off-by: Roeland Jago Douma --- apps/files_sharing/lib/Controller/ShareController.php | 1 + apps/files_sharing/templates/public.php | 3 ++- apps/files_sharing/tests/Controller/ShareControllerTest.php | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index 1e3cbb5102..15f5a2e2e6 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -321,6 +321,7 @@ class ShareController extends AuthPublicShareController { $shareTmpl['dir'] = ''; $shareTmpl['nonHumanFileSize'] = $share->getNode()->getSize(); $shareTmpl['fileSize'] = \OCP\Util::humanFileSize($share->getNode()->getSize()); + $shareTmpl['hideDownload'] = $share->getHideDownload(); // Show file list $hideFileList = false; diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index da80f8d137..cbcf32a8d8 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -18,6 +18,7 @@ + getIniWrapper()->getBytes('upload_max_filesize'); $post_max_size = OC::$server->getIniWrapper()->getBytes('post_max_size'); @@ -97,4 +98,4 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size); data-url="getURLGenerator()->linkTo('files', 'ajax/upload.php')); ?>" /> - \ No newline at end of file + diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php index a01560d028..87d06fb7df 100644 --- a/apps/files_sharing/tests/Controller/ShareControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php @@ -287,7 +287,8 @@ class ShareControllerTest extends \Test\TestCase { 'shareUrl' => null, 'previewImage' => null, 'previewURL' => 'downloadURL', - 'note' => $note + 'note' => $note, + 'hideDownload' => false ); $csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();