From fc2d5383119f548f58b5000ebb94422b7feb08a7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20M=C3=BCller?= Date: Fri, 12 Jul 2013 17:03:51 +0200 Subject: [PATCH] new admin setting added which allows to turn off anonymous uploads --- apps/files/index.php | 1 + apps/files/templates/index.php | 2 +- core/js/share.js | 7 ++++++- settings/admin.php | 3 ++- settings/templates/admin.php | 10 +++++++++- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/apps/files/index.php b/apps/files/index.php index 2338cf439e4..892f75a3513 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -138,5 +138,6 @@ if ($needUpgrade) { $tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $tmpl->assign('usedSpacePercent', (int)$storageInfo['relative']); $tmpl->assign('isPublic', false); + $tmpl->assign('publicUploadEnabled', \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes')); $tmpl->printPage(); } diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 7d679bc4bf6..dacd2be0b32 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -61,7 +61,7 @@
t('Nothing in here. Upload something!'))?>
- +
+ + +
diff --git a/core/js/share.js b/core/js/share.js index 21e352ee1c6..4c8fd874107 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -161,7 +161,12 @@ OC.Share={ // respective checkbox should be checked or // not. + var publicUploadEnabled = $('#filestable').data('allow-public-upload'); + if (typeof publicUploadEnabled == 'undefined') { + publicUploadEnabled = 'no'; + } var allowPublicUploadStatus = false; + $.each(data.shares, function(key, value) { if (allowPublicUploadStatus) { return true; @@ -181,7 +186,7 @@ OC.Share={ html += '
'; html += ''; html += '
'; - if (itemType === 'folder' && (possiblePermissions & OC.PERMISSION_CREATE)) { + if (itemType === 'folder' && (possiblePermissions & OC.PERMISSION_CREATE) && publicUploadEnabled === 'yes') { html += '
> /> + value="1" />
t('Allow users to share items to the public with links')); ?>
> + /> +
+ t('Allow users to enable others to anonymously upload into their publicly shared folders')); ?> +
>