diff --git a/src/js/yunohost/controllers/users.js b/src/js/yunohost/controllers/users.js index 7a26ce37..fb2524c2 100644 --- a/src/js/yunohost/controllers/users.js +++ b/src/js/yunohost/controllers/users.js @@ -203,11 +203,9 @@ data.password_min_length = PASSWORD_MIN_LENGTH; c.view('user/user_create', data, function(){ var usernameField = $('#username'); - usernameField.on('blur', function(){ - var emailField = $('#email'); - if (emailField.val() == '') { - emailField.val(usernameField.val()); - } + usernameField.on('input', function(){ + var emailLeft = $('#email-left'); + emailLeft.html(usernameField.val()); }); }); }); @@ -225,9 +223,7 @@ c.params['mailbox_quota'] += "M"; } else {c.params['mailbox_quota'] = 0;} - - // Compute email field - c.params['mail'] = c.params['email'] + c.params['domain']; + c.params['domain'] = c.params['domain'].slice(1); c.api('POST', '/users', c.params.toHash(), function(data) { c.redirect_to('#/users'); diff --git a/src/locales/en.json b/src/locales/en.json index a55f6b9d..240184a8 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -269,6 +269,7 @@ "system_upgrade_all_applications_btn": "Upgrade all applications", "system_upgrade_all_packages_btn": "Upgrade all packages", "tcp": "TCP", + "tip_about_user_email": "Users are created with an associated email address (and XMPP account) with the format username@domain.tld. Additional email aliases and email forwards can later be added by the admin and the user.", "tools": "Tools", "tools_adminpw": "Change administration password", "tools_adminpw_confirm_placeholder": "Confirm the new password", diff --git a/src/views/user/user_create.ms b/src/views/user/user_create.ms index f326c3fe..ff7d34c3 100644 --- a/src/views/user/user_create.ms +++ b/src/views/user/user_create.ms @@ -28,21 +28,35 @@
johndoe
+