v1.18.x
Barış Soner Uşaklı 6 years ago
parent 27a90b7a78
commit 669a5135e1

@ -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."
}

@ -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",

@ -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;
}

@ -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);
},

Loading…
Cancel
Save