]> source.dussan.org Git - nextcloud-server.git/commitdiff
no anonymous upload on files only folders
authorThomas Müller <thomas.mueller@tmit.eu>
Fri, 5 Jul 2013 08:53:59 +0000 (10:53 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Fri, 5 Jul 2013 08:53:59 +0000 (10:53 +0200)
apps/files_sharing/public.php
core/js/share.js

index fb18bc2624894e53b827fc107595c03964fcaeea..96fe12fc86a2b1f3f6cb458f7acfd0a534cfa624 100644 (file)
@@ -151,6 +151,9 @@ if (isset($path)) {
                if (\OCP\App::isEnabled('files_encryption')) {
                        $allowPublicUploadEnabled = false;
                }
+               if (isset($file)) {
+                       $allowPublicUploadEnabled = false;
+               }
                $tmpl->assign('allowPublicUploadEnabled', $allowPublicUploadEnabled);
                $tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
                $tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
index 588202d22739f1b3d1a15a35db5e6d10ba9b77f1..778a9f8e2015638c141f2d469dce7057b3e174b8 100644 (file)
@@ -181,11 +181,13 @@ OC.Share={
                                html += '<div id="linkPass">';
                                html += '<input id="linkPassText" type="password" placeholder="'+t('core', 'Password')+'" />';
                                html += '</div>';
-                               html += '<div id="allowPublicUploadWrapper" style="display:none;">';
-                               html += '<input type="checkbox" value="1" name="allowPublicUpload" id="sharingDialogAllowPublicUpload"' + ((allowPublicUploadStatus) ? 'checked="checked"' : '') + ' />';
-                               html += '<label for="sharingDialogAllowPublicUpload">' + t('core', 'Allow Public Upload') + '</label>';
-                               html += '</div></div>';
-                               html += '<form id="emailPrivateLink" >';
+                if (itemType == 'folder') {
+                    html += '<div id="allowPublicUploadWrapper" style="display:none;">';
+                    html += '<input type="checkbox" value="1" name="allowPublicUpload" id="sharingDialogAllowPublicUpload"' + ((allowPublicUploadStatus) ? 'checked="checked"' : '') + ' />';
+                    html += '<label for="sharingDialogAllowPublicUpload">' + t('core', 'Allow Public Upload') + '</label>';
+                    html += '</div>';
+                }
+                               html += '</div><form id="emailPrivateLink" >';
                                html += '<input id="email" style="display:none; width:62%;" value="" placeholder="'+t('core', 'Email link to person')+'" type="text" />';
                                html += '<input id="emailButton" style="display:none;" type="submit" value="'+t('core', 'Send')+'" />';
                                html += '</form>';