diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 572ccc47b7..7f780fd09e 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -238,6 +238,11 @@ OCA.Sharing.PublicApp = { $(this).select(); }); + $(document).on('click', '.content-wrapper-upload', function (e) { + //e.preventDefault(); + $('#file_upload_start').focus().trigger('click'); + }); + $('.save-form').submit(function (event) { event.preventDefault(); @@ -302,7 +307,7 @@ OCA.Sharing.PublicApp = { $('#save-button-confirm') .removeClass("icon-loading-small") .addClass("icon-confirm"); - + } else { $('#save-button-confirm') @@ -314,7 +319,7 @@ OCA.Sharing.PublicApp = { toggleLoading(); var location = window.location.protocol + '//' + window.location.host + OC.webroot; - + if(remote.substr(-1) !== '/') { remote += '/' }; diff --git a/apps/files_sharing/lib/API/Share20OCS.php b/apps/files_sharing/lib/API/Share20OCS.php index 90e1f19130..b10c51ce2c 100644 --- a/apps/files_sharing/lib/API/Share20OCS.php +++ b/apps/files_sharing/lib/API/Share20OCS.php @@ -602,6 +602,7 @@ class Share20OCS { if ($newPermissions !== null && $newPermissions !== \OCP\Constants::PERMISSION_READ && + $newPermissions !== (\OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE) && $newPermissions !== (\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE)) { $share->getNode()->unlock(ILockingProvider::LOCK_SHARED); return new \OC_OCS_Result(null, 400, $this->l->t('Can\'t change permissions for public share links')); diff --git a/apps/files_sharing/lib/Controllers/ShareController.php b/apps/files_sharing/lib/Controllers/ShareController.php index 96c0a0ca55..baf2fc9ed1 100644 --- a/apps/files_sharing/lib/Controllers/ShareController.php +++ b/apps/files_sharing/lib/Controllers/ShareController.php @@ -49,7 +49,6 @@ use OCP\ILogger; use OCP\IUserManager; use OCP\ISession; use OCP\IPreview; -use OCA\Files_Sharing\Helper; use OCP\Util; use OCA\Files_Sharing\Activity; use \OCP\Files\NotFoundException; @@ -314,6 +313,7 @@ class ShareController extends Controller { $shareTmpl['fileSize'] = \OCP\Util::humanFileSize($share->getNode()->getSize()); // Show file list + $hideFileList = false; if ($share->getNode() instanceof \OCP\Files\Folder) { $shareTmpl['dir'] = $rootFolder->getRelativePath($path->getPath()); @@ -329,12 +329,14 @@ class ShareController extends Controller { $uploadLimit = Util::uploadLimit(); $maxUploadFilesize = min($freeSpace, $uploadLimit); + $hideFileList = $share->getPermissions() & \OCP\Constants::PERMISSION_READ ? false : true; $folder = new Template('files', 'list', ''); $folder->assign('dir', $rootFolder->getRelativePath($path->getPath())); $folder->assign('dirToken', $token); $folder->assign('permissions', \OCP\Constants::PERMISSION_READ); $folder->assign('isPublic', true); + $folder->assign('hideFileList', $hideFileList); $folder->assign('publicUploadEnabled', 'no'); $folder->assign('uploadMaxFilesize', $maxUploadFilesize); $folder->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); @@ -345,6 +347,8 @@ class ShareController extends Controller { $shareTmpl['folder'] = $folder->fetchPage(); } + $shareTmpl['hideFileList'] = $hideFileList; + $shareTmpl['shareOwner'] = $this->userManager->get($share->getShareOwner())->getDisplayName(); $shareTmpl['downloadURL'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.downloadShare', array('token' => $token)); $shareTmpl['maxSizeAnimateGif'] = $this->config->getSystemValue('max_filesize_animated_gifs_public_sharing', 10); $shareTmpl['previewEnabled'] = $this->config->getSystemValue('enable_previews', true); diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index e39d1b0807..3707bad92f 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -66,26 +66,28 @@ OCP\Util::addscript('files', 'keyboardshortcuts');
- - - - + if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)) { + if ($_['server2serversharing']) { + ?> + + + + + + + "/> + t('Download'))?> + - - "/> - t('Download'))?> -
- -
-
+
+
> +
@@ -112,7 +114,21 @@ OCP\Util::addscript('files', 'keyboardshortcuts');
+ +
+
+

Upload files to

+ Select +
+ +
+ + +
+
+