diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/js/share.js | 30 | ||||
-rw-r--r-- | core/templates/404.php | 16 |
2 files changed, 31 insertions, 15 deletions
diff --git a/core/js/share.js b/core/js/share.js index e59669cbc2b..b4b5159b0b5 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -592,8 +592,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) { }); }); @@ -609,13 +608,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')); }); } }); diff --git a/core/templates/404.php b/core/templates/404.php index ee17f0de8e1..bf1e03e6bc9 100644 --- a/core/templates/404.php +++ b/core/templates/404.php @@ -7,9 +7,13 @@ if(!isset($_)) {//also provide standalone error page exit; } ?> -<ul> - <li class='error'> - <?php p($l->t( 'Cloud not found' )); ?><br/> - <p class='hint'><?php if(isset($_['file'])) p($_['file'])?></p> - </li> -</ul> +<?php if (isset($_['content'])): ?> + <?php print_unescaped($_['content']) ?> +<?php else: ?> + <ul> + <li class="error"> + <?php p($l->t( 'Cloud not found' )); ?><br/> + <p class='hint'><?php if(isset($_['file'])) p($_['file'])?></p> + </li> + </ul> +<?php endif; ?> |