diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-12-16 09:08:38 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-12-16 09:10:22 +0100 |
commit | 3b61f76ca0eb9ad9487fa2ab64dda97e51f9df57 (patch) | |
tree | 2eede9268660f3b32646ae375e37cd542d4f36a2 /settings/js | |
parent | 5b9c453071fe900529cd26b88fbc681d8b153b43 (diff) | |
download | nextcloud-server-3b61f76ca0eb9ad9487fa2ab64dda97e51f9df57.tar.gz nextcloud-server-3b61f76ca0eb9ad9487fa2ab64dda97e51f9df57.zip |
Send mail for new users
* supply mail address
* send mail with username and URL to that mail address
* option to temporary enable this feature
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/users/users.js | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 62e18d1be04..91bc34bb754 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -690,6 +690,7 @@ $(document).ready(function () { event.preventDefault(); var username = $('#newusername').val(); var password = $('#newuserpassword').val(); + var email = $('#newemail').val(); if ($.trim(username) === '') { OC.dialogs.alert( t('settings', 'A valid username must be provided'), @@ -702,14 +703,24 @@ $(document).ready(function () { t('settings', 'Error creating user')); return false; } - var groups = $('#newusergroups').val(); + if(!$('#CheckboxMailOnUserCreate').is(':checked')) { + email = ''; + } + if ($('#CheckboxMailOnUserCreate').is(':checked') && $.trim(email) === '') { + OC.dialogs.alert( + t('settings', 'A valid email must be provided'), + t('settings', 'Error creating user')); + return false; + } + var groups = $('#newusergroups').val() || []; $('#newuser').get(0).reset(); $.post( OC.generateUrl('/settings/users/users'), { username: username, password: password, - groups: groups + groups: groups, + email: email }, function (result) { if (result.groups) { @@ -769,6 +780,14 @@ $(document).ready(function () { $("#userlist .userBackend").hide(); } }); + // Option to display/hide the "E-Mail" input field + $('#CheckboxMailOnUserCreate').click(function() { + if ($('#CheckboxMailOnUserCreate').is(':checked')) { + $("#newemail").show(); + } else { + $("#newemail").hide(); + } + }); // trigger loading of users on startup UserList.update(UserList.currentGid); |