]> source.dussan.org Git - nextcloud-server.git/commitdiff
no anonymous upload on read-only folders
authorThomas Müller <thomas.mueller@tmit.eu>
Fri, 5 Jul 2013 09:23:08 +0000 (11:23 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Fri, 5 Jul 2013 09:23:08 +0000 (11:23 +0200)
core/js/share.js

index 588202d22739f1b3d1a15a35db5e6d10ba9b77f1..9494637c3dc2f74685ec1fd57bd99747b8acaa96 100644 (file)
@@ -163,10 +163,10 @@ OC.Share={
 
                        var allowPublicUploadStatus = false;
                        $.each(data.shares, function(key, value) {
-                         if (allowPublicUploadStatus) {
-                            return true;
-                          }
-                         allowPublicUploadStatus = (value.permissions & OC.PERMISSION_CREATE) ? true : false;
+                               if (allowPublicUploadStatus) {
+                                       return true;
+                               }
+                               allowPublicUploadStatus = (value.permissions & OC.PERMISSION_CREATE) ? true : false;
                        });
 
                        html += '<input id="shareWith" type="text" placeholder="'+t('core', 'Share with')+'" />';
@@ -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 (possiblePermissions & OC.PERMISSION_CREATE) {
+                                       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>';