Merge pull request #9030 from owncloud/default-allow-user-mount-backends
AllowUserMount defaults now to all backends fixes #7958
This commit is contained in:
commit
3069091e61
|
@ -25,3 +25,7 @@ tr:hover>td.remove>img { visibility:visible; cursor:pointer; }
|
||||||
#externalStorage td.status .success {
|
#externalStorage td.status .success {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#userMountingBackends {
|
||||||
|
padding-left: 25px;
|
||||||
|
}
|
||||||
|
|
|
@ -310,19 +310,28 @@ $(document).ready(function() {
|
||||||
OC.msg.startSaving('#userMountingMsg');
|
OC.msg.startSaving('#userMountingMsg');
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
OC.AppConfig.setValue('files_external', 'allow_user_mounting', 'yes');
|
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 {
|
} else {
|
||||||
OC.AppConfig.setValue('files_external', 'allow_user_mounting', 'no');
|
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')}});
|
OC.msg.finishedSaving('#userMountingMsg', {status: 'success', data: {message: t('settings', 'Saved')}});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('input[name="allowUserMountingBackends\\[\\]"]').bind('change', function() {
|
$('input[name="allowUserMountingBackends\\[\\]"]').bind('change', function() {
|
||||||
OC.msg.startSaving('#userMountingMsg');
|
OC.msg.startSaving('#userMountingMsg');
|
||||||
var user_mounting_backends = $('input[name="allowUserMountingBackends\\[\\]"]:checked').map(function(){return $(this).val();}).get();
|
var userMountingBackends = $('input[name="allowUserMountingBackends\\[\\]"]:checked').map(function(){return $(this).val();}).get();
|
||||||
OC.AppConfig.setValue('files_external', 'user_mounting_backends', user_mounting_backends.join());
|
OC.AppConfig.setValue('files_external', 'user_mounting_backends', userMountingBackends.join());
|
||||||
OC.msg.finishedSaving('#userMountingMsg', {status: 'success', data: {message: t('settings', 'Saved')}});
|
OC.msg.finishedSaving('#userMountingMsg', {status: 'success', data: {message: t('settings', 'Saved')}});
|
||||||
|
|
||||||
|
// disable allowUserMounting
|
||||||
|
if(userMountingBackends.length === 0) {
|
||||||
|
$('#allowUserMounting').prop('checked', false);
|
||||||
|
$('#allowUserMounting').trigger('change');
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@
|
||||||
value="1" <?php if ($_['allowUserMounting'] == 'yes') print_unescaped(' checked="checked"'); ?> />
|
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>
|
<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 p($l->t('Allow users to mount the following external storage')); ?><br />
|
||||||
<?php $i = 0; foreach ($_['personal_backends'] as $class => $backend): ?>
|
<?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"'); ?> />
|
<input type="checkbox" id="allowUserMountingBackends<?php p($i); ?>" name="allowUserMountingBackends[]" value="<?php p($class); ?>" <?php if ($backend['enabled']) print_unescaped(' checked="checked"'); ?> />
|
||||||
|
|
Loading…
Reference in New Issue