mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 23:40:38 +01:00
closes #4468
This commit is contained in:
@@ -77,10 +77,17 @@ usersController.banned = function(req, res, next) {
|
||||
};
|
||||
|
||||
usersController.registrationQueue = function(req, res, next) {
|
||||
var page = parseInt(req.query.page, 10) || 1;
|
||||
var itemsPerPage = 20;
|
||||
var start = (page - 1) * 20;
|
||||
var stop = start + itemsPerPage - 1;
|
||||
var invitations;
|
||||
async.parallel({
|
||||
registrationQueueCount: function(next) {
|
||||
db.sortedSetCard('registration:queue', next);
|
||||
},
|
||||
users: function(next) {
|
||||
user.getRegistrationQueue(0, -1, next);
|
||||
user.getRegistrationQueue(start, stop, next);
|
||||
},
|
||||
invites: function(next) {
|
||||
async.waterfall([
|
||||
@@ -118,6 +125,8 @@ usersController.registrationQueue = function(req, res, next) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
var pageCount = Math.max(1, Math.ceil(data.registrationQueueCount / itemsPerPage));
|
||||
data.pagination = pagination.create(page, pageCount);
|
||||
res.render('admin/manage/registration', data);
|
||||
});
|
||||
};
|
||||
@@ -146,7 +155,7 @@ function getUsers(set, section, req, res, next) {
|
||||
var data = {
|
||||
users: results.users,
|
||||
page: page,
|
||||
pageCount: Math.ceil(results.count / resultsPerPage)
|
||||
pageCount: Math.max(1, Math.ceil(results.count / resultsPerPage))
|
||||
};
|
||||
data[section] = true;
|
||||
render(req, res, data);
|
||||
|
||||
Reference in New Issue
Block a user