@@ -26,8 +26,8 @@ var MOUNT_OPTIONS_DROPDOWN_TEMPLATE =
2626 ' <input id="mountOptionsPreviews" name="previews" type="checkbox" value="true" checked="checked"/>' +
2727 ' <label for="mountOptionsPreviews">{{t "files_external" "Enable previews"}}</label>' +
2828 ' </div>' +
29- ' <div class="optionRow">' +
30- ' <input id="mountOptionsSharing" name="enable_sharing" type="checkbox" value="true"/>' +
29+ ' <div class="optionRow" title="{{mountOptionsSharingTitle}}" >' +
30+ ' <input id="mountOptionsSharing" name="enable_sharing" type="checkbox" value="true" {{#if sharingDisabled}}disabled{{/if}} />' +
3131 ' <label for="mountOptionsSharing">{{t "files_external" "Enable sharing"}}</label>' +
3232 ' </div>' +
3333 ' <div class="optionRow">' +
@@ -487,8 +487,9 @@ MountOptionsDropdown.prototype = {
487487 * @param {Object } $container container
488488 * @param {Object } mountOptions mount options
489489 * @param {Array } visibleOptions enabled mount options
490+ * @param {GlobalStorageConfig } storageConfig
490491 */
491- show : function ( $container , mountOptions , visibleOptions ) {
492+ show : function ( $container , mountOptions , visibleOptions , storageConfig ) {
492493 if ( MountOptionsDropdown . _last ) {
493494 MountOptionsDropdown . _last . hide ( ) ;
494495 }
@@ -499,8 +500,12 @@ MountOptionsDropdown.prototype = {
499500 MountOptionsDropdown . _template = template ;
500501 }
501502
503+ var sharingDisabled = [ 'password::sessioncredentials' ] . includes ( storageConfig . authMechanism ) ;
504+
502505 var $el = $ ( template ( {
503506 mountOptionsEncodingLabel : t ( 'files_external' , 'Compatibility with Mac NFD encoding (slow)' ) ,
507+ mountOptionsSharingTitle : sharingDisabled ? t ( 'files_external' , 'Sharing cannot be enabled due to the chosen authentication method' ) : '' ,
508+ sharingDisabled : sharingDisabled ,
504509 } ) ) ;
505510 this . $el = $el ;
506511
@@ -1371,7 +1376,7 @@ MountConfigListView.prototype = _.extend({
13711376 visibleOptions . push ( 'enable_sharing' ) ;
13721377 }
13731378
1374- dropDown . show ( $toggle , storage . mountOptions || [ ] , visibleOptions ) ;
1379+ dropDown . show ( $toggle , storage . mountOptions || [ ] , visibleOptions , storage ) ;
13751380 $ ( 'body' ) . on ( 'mouseup.mountOptionsDropdown' , function ( event ) {
13761381 var $target = $ ( event . target ) ;
13771382 if ( $toggle . has ( $target ) . length ) {
0 commit comments