summaryrefslogtreecommitdiffstats
path: root/settings/js/users
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-12-18 22:32:37 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-12-18 22:32:37 +0100
commit5327b8043019ec8f0cfe19d70794978570bba4bc (patch)
tree741099c4027b3649760b6e0cbcac5f0e1580fad9 /settings/js/users
parent8b467ffa6e5ba3ac1e491072a20cad13e0bb940e (diff)
parent04e172c2ce9a43ea8884384b22efd5d07f027664 (diff)
downloadnextcloud-server-5327b8043019ec8f0cfe19d70794978570bba4bc.tar.gz
nextcloud-server-5327b8043019ec8f0cfe19d70794978570bba4bc.zip
Merge pull request #12870 from owncloud/send-mail-new-user
Send mail for new users
Diffstat (limited to 'settings/js/users')
-rw-r--r--settings/js/users/users.js23
1 files changed, 21 insertions, 2 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index d910e1ec129..e0eb5ff1601 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -695,6 +695,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'),
@@ -707,14 +708,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) {
@@ -774,6 +785,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();
+ }
+ });
// calculate initial limit of users to load
var initialUserCountLimit = 20,