Skip to content

Node.js based forum software built for the modern web

closes #6768

Barış Soner Uşaklı669a5135e164
diff --git a/public/language/en-GB/admin/manage/users.json b/public/language/en-GB/admin/manage/users.json
index 2e4cfa2a5c..6a17cbf016 100644
--- a/public/language/en-GB/admin/manage/users.json
+++ b/public/language/en-GB/admin/manage/users.json
@@ -93,7 +93,7 @@
"alerts.error-x": "<strong>Error</strong><p>%1</p>",
"alerts.create-success": "User created!",
- "alerts.prompt-email": "Email: ",
+ "alerts.prompt-email": "Emails: ",
"alerts.email-sent-to": "An invitation email has been sent to %1",
"alerts.x-users-found": "%1 user(s) found! Search took %2 ms."
}
\ No newline at end of file
diff --git a/public/language/en-GB/users.json b/public/language/en-GB/users.json
index 5c9d8b93a4..18cf03fde3 100644
--- a/public/language/en-GB/users.json
+++ b/public/language/en-GB/users.json
@@ -10,6 +10,7 @@
"filter-by": "Filter By",
"online-only": "Online only",
"invite": "Invite",
+ "prompt-email": "Emails:",
"invitation-email-sent": "An invitation email has been sent to %1",
"user_list": "User List",
"recent_topics": "Recent Topics",
diff --git a/public/src/client/users.js b/public/src/client/users.js
index 3d541e0863..bf6873e693 100644
--- a/public/src/client/users.js
+++ b/public/src/client/users.js
@@ -130,7 +130,7 @@ define('forum/users', ['translator', 'benchpress'], function (translator, Benchp
function handleInvite() {
$('[component="user/invite"]').on('click', function () {
- bootbox.prompt('Email: ', function (email) {
+ bootbox.prompt('[[users:prompt-email]]', function (email) {
if (!email) {
return;
}
diff --git a/src/socket.io/user.js b/src/socket.io/user.js
index ece95c875e..582262b20d 100644
--- a/src/socket.io/user.js
+++ b/src/socket.io/user.js
@@ -289,21 +289,19 @@ SocketUser.invite = function (socket, email, callback) {
return next(new Error('[[error:no-privileges]]'));
}
- var max = parseInt(meta.config.maximumInvites, 10);
- if (!max) {
- return user.sendInvitationEmail(socket.uid, email, callback);
- }
-
async.waterfall([
function (next) {
user.getInvitesNumber(socket.uid, next);
},
function (invites, next) {
- if (!isAdmin && invites >= max) {
+ var max = parseInt(meta.config.maximumInvites, 10);
+ if (!isAdmin && max && invites >= max) {
return next(new Error('[[error:invite-maximum-met, ' + invites + ', ' + max + ']]'));
}
-
- user.sendInvitationEmail(socket.uid, email, next);
+ email = email.split(',').map(email => email.trim()).filter(Boolean);
+ async.eachSeries(email, function (email, next) {
+ user.sendInvitationEmail(socket.uid, email, next);
+ }, next);
},
], next);
},