diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-06-16 13:10:01 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-06-16 13:10:01 +0200 |
commit | 3069091e619964408549a57be2a8f84e54feedbc (patch) | |
tree | 5b7a2eb7c7c9dbf7c5504563258e3d744f8d9bb9 | |
parent | 83b45926ee913522bbfb1386533b2ce9a2eac700 (diff) | |
parent | 0a2c676cda48aee0a9e788cae5fafeee5bdf0dec (diff) | |
download | nextcloud-server-3069091e619964408549a57be2a8f84e54feedbc.tar.gz nextcloud-server-3069091e619964408549a57be2a8f84e54feedbc.zip |
Merge pull request #9030 from owncloud/default-allow-user-mount-backends
AllowUserMount defaults now to all backends fixes #7958
-rw-r--r-- | apps/files_external/css/settings.css | 4 | ||||
-rw-r--r-- | apps/files_external/js/settings.js | 17 | ||||
-rw-r--r-- | apps/files_external/templates/settings.php | 2 |
3 files changed, 18 insertions, 5 deletions
diff --git a/apps/files_external/css/settings.css b/apps/files_external/css/settings.css index 01dd5aece8c..758c52ae852 100644 --- a/apps/files_external/css/settings.css +++ b/apps/files_external/css/settings.css @@ -25,3 +25,7 @@ tr:hover>td.remove>img { visibility:visible; cursor:pointer; } #externalStorage td.status .success { border-radius: 50%; } + +#userMountingBackends { + padding-left: 25px; +} diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index 00793a614c2..348fecf0648 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -310,19 +310,28 @@ $(document).ready(function() { OC.msg.startSaving('#userMountingMsg'); if (this.checked) { OC.AppConfig.setValue('files_external', 'allow_user_mounting', 'yes'); - $('#userMountingBackups').removeClass('hidden'); + $('input[name="allowUserMountingBackends\\[\\]"]').prop('checked', true); + $('#userMountingBackends').removeClass('hidden'); + $('input[name="allowUserMountingBackends\\[\\]"]').eq(0).trigger('change'); } else { OC.AppConfig.setValue('files_external', 'allow_user_mounting', 'no'); - $('#userMountingBackups').addClass('hidden'); + $('#userMountingBackends').addClass('hidden'); } OC.msg.finishedSaving('#userMountingMsg', {status: 'success', data: {message: t('settings', 'Saved')}}); }); $('input[name="allowUserMountingBackends\\[\\]"]').bind('change', function() { OC.msg.startSaving('#userMountingMsg'); - var user_mounting_backends = $('input[name="allowUserMountingBackends\\[\\]"]:checked').map(function(){return $(this).val();}).get(); - OC.AppConfig.setValue('files_external', 'user_mounting_backends', user_mounting_backends.join()); + var userMountingBackends = $('input[name="allowUserMountingBackends\\[\\]"]:checked').map(function(){return $(this).val();}).get(); + OC.AppConfig.setValue('files_external', 'user_mounting_backends', userMountingBackends.join()); OC.msg.finishedSaving('#userMountingMsg', {status: 'success', data: {message: t('settings', 'Saved')}}); + + // disable allowUserMounting + if(userMountingBackends.length === 0) { + $('#allowUserMounting').prop('checked', false); + $('#allowUserMounting').trigger('change'); + + } }); }); diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index df80ed10993..98fcf4a0ed4 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -131,7 +131,7 @@ value="1" <?php if ($_['allowUserMounting'] == 'yes') print_unescaped(' checked="checked"'); ?> /> <label for="allowUserMounting"><?php p($l->t('Enable User External Storage')); ?></label> <span id="userMountingMsg" class="msg"></span> - <p id="userMountingBackups"<?php if ($_['allowUserMounting'] != 'yes'): ?> class="hidden"<?php endif; ?>> + <p id="userMountingBackends"<?php if ($_['allowUserMounting'] != 'yes'): ?> class="hidden"<?php endif; ?>> <?php p($l->t('Allow users to mount the following external storage')); ?><br /> <?php $i = 0; foreach ($_['personal_backends'] as $class => $backend): ?> <input type="checkbox" id="allowUserMountingBackends<?php p($i); ?>" name="allowUserMountingBackends[]" value="<?php p($class); ?>" <?php if ($backend['enabled']) print_unescaped(' checked="checked"'); ?> /> |