diff options
Diffstat (limited to 'settings/js/users/users.js')
-rw-r--r-- | settings/js/users/users.js | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 3cf7b5e810a..55939c289c0 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -918,7 +918,7 @@ $(document).ready(function () { })); return false; } - if ($.trim(password) === '') { + if ($.trim(password) === '' && !$('#CheckboxMailPasswordOnUserCreate').is(':checked')) { OC.Notification.showTemporary(t('settings', 'Error creating user: {message}', { message: t('settings', 'A valid password must be provided') })); @@ -1044,15 +1044,37 @@ $(document).ready(function () { if ($('#CheckboxMailOnUserCreate').is(':checked')) { $("#newemail").show(); + $("#MailPasswordOnUserCreateSetting").show(); } + + if ($('#CheckboxMailPasswordOnUserCreate').is(':checked')) { + $("#newuserpassword").hide(); + } else { + $("#newuserpassword").show(); + } + // Option to display/hide the "E-Mail" input field $('#CheckboxMailOnUserCreate').click(function() { if ($('#CheckboxMailOnUserCreate').is(':checked')) { $("#newemail").show(); + $("#MailPasswordOnUserCreateSetting").show(); OCP.AppConfig.setValue('core', 'umgmt_send_email', 'true'); } else { $("#newemail").hide(); + $("#MailPasswordOnUserCreateSetting").hide(); OCP.AppConfig.setValue('core', 'umgmt_send_email', 'false'); + OCP.AppConfig.setValue('core', 'umgmt_send_passwordlink', 'false'); + $('#CheckboxMailPasswordOnUserCreate').removeAttr('checked'); + } + }); + + $('#CheckboxMailPasswordOnUserCreate').click(function() { + if ($('#CheckboxMailPasswordOnUserCreate').is(':checked')) { + OCP.AppConfig.setValue('core', 'umgmt_send_passwordlink', 'true'); + $("#newuserpassword").hide(); + } else { + OCP.AppConfig.setValue('core', 'umgmt_send_passwordlink', 'false'); + $("#newuserpassword").show(); } }); |