mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
Maximum invites, invites stored
Added the ability for admins to restrict the maximum amount of invites a user can make. Invites are stored and displayed in the registration queue admin page.
This commit is contained in:
@@ -150,14 +150,26 @@ usersController.getUsersForSearch = function(req, res, next) {
|
||||
};
|
||||
|
||||
function render(req, res, data, next) {
|
||||
plugins.fireHook('filter:users.build', {req: req, res: res, templateData: data}, function(err, data) {
|
||||
plugins.fireHook('filter:users.build', { req: req, res: res, templateData: data }, function(err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
data.templateData.inviteOnly = meta.config.registrationType === 'invite-only';
|
||||
data.templateData['reputation:disabled'] = parseInt(meta.config['reputation:disabled'], 10) === 1;
|
||||
res.render('users', data.templateData);
|
||||
if (!req.uid) {
|
||||
return next(new Error('[[error:no-privileges]]'));
|
||||
}
|
||||
|
||||
user.getInvitesNumber(req.uid, function(err, num) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
data.templateData.invites = num;
|
||||
data.templateData.maximumInvites = meta.config.maximumInvites;
|
||||
data.templateData.inviteOnly = meta.config.registrationType === 'invite-only';
|
||||
data.templateData['reputation:disabled'] = parseInt(meta.config['reputation:disabled'], 10) === 1;
|
||||
res.render('users', data.templateData);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user