mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 23:40:38 +01:00
Fix space-before-function-paren linter rule
This commit is contained in:
@@ -15,40 +15,40 @@ var usersController = {};
|
||||
var userFields = ['uid', 'username', 'userslug', 'email', 'postcount', 'joindate', 'banned',
|
||||
'reputation', 'picture', 'flags', 'lastonline', 'email:confirmed'];
|
||||
|
||||
usersController.search = function(req, res, next) {
|
||||
usersController.search = function (req, res, next) {
|
||||
res.render('admin/manage/users', {
|
||||
search_display: '',
|
||||
users: []
|
||||
});
|
||||
};
|
||||
|
||||
usersController.sortByJoinDate = function(req, res, next) {
|
||||
usersController.sortByJoinDate = function (req, res, next) {
|
||||
getUsers('users:joindate', 'latest', undefined, undefined, req, res, next);
|
||||
};
|
||||
|
||||
usersController.notValidated = function(req, res, next) {
|
||||
usersController.notValidated = function (req, res, next) {
|
||||
getUsers('users:notvalidated', 'notvalidated', undefined, undefined, req, res, next);
|
||||
};
|
||||
|
||||
usersController.noPosts = function(req, res, next) {
|
||||
usersController.noPosts = function (req, res, next) {
|
||||
getUsers('users:postcount', 'noposts', '-inf', 0, req, res, next);
|
||||
};
|
||||
|
||||
usersController.flagged = function(req, res, next) {
|
||||
usersController.flagged = function (req, res, next) {
|
||||
getUsers('users:flags', 'mostflags', 1, '+inf', req, res, next);
|
||||
};
|
||||
|
||||
usersController.inactive = function(req, res, next) {
|
||||
usersController.inactive = function (req, res, next) {
|
||||
var timeRange = 1000 * 60 * 60 * 24 * 30 * (parseInt(req.query.months, 10) || 3);
|
||||
var cutoff = Date.now() - timeRange;
|
||||
getUsers('users:online', 'inactive', '-inf', cutoff, req, res, next);
|
||||
};
|
||||
|
||||
usersController.banned = function(req, res, next) {
|
||||
usersController.banned = function (req, res, next) {
|
||||
getUsers('users:banned', 'banned', undefined, undefined, req, res, next);
|
||||
};
|
||||
|
||||
usersController.registrationQueue = 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;
|
||||
@@ -56,37 +56,37 @@ usersController.registrationQueue = function(req, res, next) {
|
||||
var invitations;
|
||||
|
||||
async.parallel({
|
||||
registrationQueueCount: function(next) {
|
||||
registrationQueueCount: function (next) {
|
||||
db.sortedSetCard('registration:queue', next);
|
||||
},
|
||||
users: function(next) {
|
||||
users: function (next) {
|
||||
user.getRegistrationQueue(start, stop, next);
|
||||
},
|
||||
customHeaders: function(next) {
|
||||
customHeaders: function (next) {
|
||||
plugins.fireHook('filter:admin.registrationQueue.customHeaders', {headers: []}, next);
|
||||
},
|
||||
invites: function(next) {
|
||||
invites: function (next) {
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
function (next) {
|
||||
user.getAllInvites(next);
|
||||
},
|
||||
function(_invitations, next) {
|
||||
function (_invitations, next) {
|
||||
invitations = _invitations;
|
||||
async.map(invitations, function(invites, next) {
|
||||
async.map(invitations, function (invites, next) {
|
||||
user.getUserField(invites.uid, 'username', next);
|
||||
}, next);
|
||||
},
|
||||
function(usernames, next) {
|
||||
invitations.forEach(function(invites, index) {
|
||||
function (usernames, next) {
|
||||
invitations.forEach(function (invites, index) {
|
||||
invites.username = usernames[index];
|
||||
});
|
||||
async.map(invitations, function(invites, next) {
|
||||
async.map(invitations, function (invites, next) {
|
||||
async.map(invites.invitations, user.getUsernameByEmail, next);
|
||||
}, next);
|
||||
},
|
||||
function(usernames, next) {
|
||||
invitations.forEach(function(invites, index) {
|
||||
invites.invitations = invites.invitations.map(function(email, i) {
|
||||
function (usernames, next) {
|
||||
invitations.forEach(function (invites, index) {
|
||||
invites.invitations = invites.invitations.map(function (email, i) {
|
||||
return {
|
||||
email: email,
|
||||
username: usernames[index][i] === '[[global:guest]]' ? '' : usernames[index][i]
|
||||
@@ -97,7 +97,7 @@ usersController.registrationQueue = function(req, res, next) {
|
||||
}
|
||||
], next);
|
||||
}
|
||||
}, function(err, data) {
|
||||
}, function (err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
@@ -116,33 +116,33 @@ function getUsers(set, section, min, max, req, res, next) {
|
||||
var byScore = min !== undefined && max !== undefined;
|
||||
|
||||
async.parallel({
|
||||
count: function(next) {
|
||||
count: function (next) {
|
||||
if (byScore) {
|
||||
db.sortedSetCount(set, min, max, next);
|
||||
} else {
|
||||
db.sortedSetCard(set, next);
|
||||
}
|
||||
},
|
||||
users: function(next) {
|
||||
users: function (next) {
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
function (next) {
|
||||
if (byScore) {
|
||||
db.getSortedSetRevRangeByScore(set, start, resultsPerPage, max, min, next);
|
||||
} else {
|
||||
user.getUidsFromSet(set, start, stop, next);
|
||||
}
|
||||
},
|
||||
function(uids, next) {
|
||||
function (uids, next) {
|
||||
user.getUsersWithFields(uids, userFields, req.uid, next);
|
||||
}
|
||||
], next);
|
||||
}
|
||||
}, function(err, results) {
|
||||
}, function (err, results) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
results.users = results.users.filter(function(user) {
|
||||
results.users = results.users.filter(function (user) {
|
||||
user.email = validator.escape(String(user.email || ''));
|
||||
return user && parseInt(user.uid, 10);
|
||||
});
|
||||
@@ -169,14 +169,14 @@ function render(req, res, data) {
|
||||
res.render('admin/manage/users', data);
|
||||
}
|
||||
|
||||
usersController.getCSV = function(req, res, next) {
|
||||
usersController.getCSV = function (req, res, next) {
|
||||
events.log({
|
||||
type: 'getUsersCSV',
|
||||
uid: req.user.uid,
|
||||
ip: req.ip
|
||||
});
|
||||
|
||||
user.getUsersCSV(function(err, data) {
|
||||
user.getUsersCSV(function (err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user