v1.18.x
Julian Lam 9 years ago
parent 92ab2699ba
commit afb0312f51

@ -171,12 +171,17 @@ function render(req, res, data, next) {
data.adminInviteOnly = registrationType === 'admin-invite-only';
data['reputation:disabled'] = parseInt(meta.config['reputation:disabled'], 10) === 1;
user.getInvitesNumber(req.uid, function(err, num) {
async.parallel({
numInvites: async.apply(user.getInvitesNumber, req.uid),
numUsers: async.apply(user.getUserCount)
}, function(err, meta) {
if (err) {
return next(err);
}
data.invites = num;
res.append('X-Total-Count', meta.numUsers);
data.invites = meta.numInvites;
res.render('users', data);
});
}

@ -33,6 +33,10 @@ var utils = require('../public/src/utils');
require('./user/invite')(User);
require('./user/password')(User);
User.getUserCount = function(callback) {
db.sortedSetCount('username:uid', '-inf', '+inf', callback);
};
User.updateLastOnlineTime = function(uid, callback) {
callback = callback || function() {};
User.getUserFields(uid, ['status', 'lastonline'], function(err, userData) {

Loading…
Cancel
Save