|
|
@ -64,19 +64,13 @@ var user = require('./../user.js'),
|
|
|
|
|
|
|
|
|
|
|
|
user.get_uid_by_userslug(req.params.userslug, function(uid) {
|
|
|
|
user.get_uid_by_userslug(req.params.userslug, function(uid) {
|
|
|
|
if(!uid) {
|
|
|
|
if(!uid) {
|
|
|
|
next();
|
|
|
|
return next();
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
user.getUserField(uid, 'banned', function(banned) {
|
|
|
|
app.build_header({ req: req, res: res }, function(err, header) {
|
|
|
|
if(banned && banned === '1') {
|
|
|
|
res.send(header + app.create_route('users/' + req.params.userslug, 'account') + templates['footer']);
|
|
|
|
next();
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
|
|
|
|
app.build_header({ req: req, res: res }, function(err, header) {
|
|
|
|
|
|
|
|
res.send(header + app.create_route('users/' + req.params.userslug, 'account') + templates['footer']);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -327,21 +321,18 @@ var user = require('./../user.js'),
|
|
|
|
|
|
|
|
|
|
|
|
function getUsersSortedByJoinDate(req, res) {
|
|
|
|
function getUsersSortedByJoinDate(req, res) {
|
|
|
|
user.getUsers('users:joindate', 0, 49, function(err, data) {
|
|
|
|
user.getUsers('users:joindate', 0, 49, function(err, data) {
|
|
|
|
data = user.filterBannedUsers(data);
|
|
|
|
|
|
|
|
res.json({ search_display: 'none', loadmore_display:'block', users:data });
|
|
|
|
res.json({ search_display: 'none', loadmore_display:'block', users:data });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getUsersSortedByPosts(req, res) {
|
|
|
|
function getUsersSortedByPosts(req, res) {
|
|
|
|
user.getUsers('users:postcount', 0, 49, function(err, data) {
|
|
|
|
user.getUsers('users:postcount', 0, 49, function(err, data) {
|
|
|
|
data = user.filterBannedUsers(data);
|
|
|
|
|
|
|
|
res.json({ search_display: 'none', loadmore_display:'block', users:data });
|
|
|
|
res.json({ search_display: 'none', loadmore_display:'block', users:data });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getUsersSortedByReputation(req, res) {
|
|
|
|
function getUsersSortedByReputation(req, res) {
|
|
|
|
user.getUsers('users:reputation', 0, 49, function(err, data) {
|
|
|
|
user.getUsers('users:reputation', 0, 49, function(err, data) {
|
|
|
|
data = user.filterBannedUsers(data);
|
|
|
|
|
|
|
|
res.json({ search_display: 'none', loadmore_display:'block', users:data });
|
|
|
|
res.json({ search_display: 'none', loadmore_display:'block', users:data });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -380,7 +371,8 @@ var user = require('./../user.js'),
|
|
|
|
else
|
|
|
|
else
|
|
|
|
data.emailClass = "hide";
|
|
|
|
data.emailClass = "hide";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.show_banned = data.banned === '1'?'':'hide';
|
|
|
|
|
|
|
|
|
|
|
|
data.uid = uid;
|
|
|
|
data.uid = uid;
|
|
|
|
data.yourid = callerUID;
|
|
|
|
data.yourid = callerUID;
|
|
|
|
data.theirid = uid;
|
|
|
|
data.theirid = uid;
|
|
|
|