diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-30 10:26:42 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-30 17:34:15 +0200 |
commit | 3b30bb23d7176c41d19fc96716cdd17446da066b (patch) | |
tree | 5df560e95b1f67908f50b2c18b8a3151d7284b07 /core | |
parent | 381fe4d7ef2ec90050070097926be2feed6c5ee8 (diff) | |
download | nextcloud-server-3b30bb23d7176c41d19fc96716cdd17446da066b.tar.gz nextcloud-server-3b30bb23d7176c41d19fc96716cdd17446da066b.zip |
fixes #4026
Diffstat (limited to 'core')
-rw-r--r-- | core/js/share.js | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/core/js/share.js b/core/js/share.js index 1fa76e62698..8825186f23d 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -581,8 +581,7 @@ $(document).ready(function() { } // Update the share information - OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', permissions, function(data) { - return; + OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', permissions, function(data) { }); }); @@ -598,13 +597,26 @@ $(document).ready(function() { }); $(document).on('focusout keyup', '#dropdown #linkPassText', function(event) { - if ( $('#linkPassText').val() != '' && (event.type == 'focusout' || event.keyCode == 13) ) { - var itemType = $('#dropdown').data('item-type'); - var itemSource = $('#dropdown').data('item-source'); - OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $('#linkPassText').val(), OC.PERMISSION_READ, function() { - console.log("password set to: '" + $('#linkPassText').val() +"' by event: " + event.type); - $('#linkPassText').val(''); - $('#linkPassText').attr('placeholder', t('core', 'Password protected')); + var linkPassText = $('#linkPassText'); + if ( linkPassText.val() != '' && (event.type == 'focusout' || event.keyCode == 13) ) { + + var allowPublicUpload = $('#sharingDialogAllowPublicUpload').is(':checked'); + var dropDown = $('#dropdown'); + var itemType = dropDown.data('item-type'); + var itemSource = dropDown.data('item-source'); + var permissions = 0; + + // Calculate permissions + if (allowPublicUpload) { + permissions = OC.PERMISSION_UPDATE + OC.PERMISSION_CREATE + OC.PERMISSION_READ; + } else { + permissions = OC.PERMISSION_READ; + } + + OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, $('#linkPassText').val(), permissions, function() { + console.log("password set to: '" + linkPassText.val() +"' by event: " + event.type); + linkPassText.val(''); + linkPassText.attr('placeholder', t('core', 'Password protected')); }); } }); |