diff --git a/public/css/style.less b/public/css/style.less index 9868acb94c..13d067a4c8 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -197,6 +197,12 @@ footer.footer { font-weight:bold; } +.account-block { + div { + padding-bottom:10px; + } +} + .account-picture-block{ display:inline-block; vertical-align:top; @@ -213,7 +219,6 @@ footer.footer { .user-profile-picture { width:128px; - margin-bottom:10px; } .user-picture-label { diff --git a/public/templates/account.tpl b/public/templates/account.tpl index b90d4c307a..7d69bb4679 100644 --- a/public/templates/account.tpl +++ b/public/templates/account.tpl @@ -17,13 +17,16 @@
-
+
diff --git a/src/categories.js b/src/categories.js index 5e42ac2063..56825f1e57 100644 --- a/src/categories.js +++ b/src/categories.js @@ -55,8 +55,7 @@ var RDB = require('./redis.js'), } function getActiveUsers(next) { - user.getMultipleUserFields(active_users, ['username', 'userslug', 'picture', 'banned'], function(users) { - users = user.filterBannedUsers(users); + user.getMultipleUserFields(active_users, ['username', 'userslug', 'picture'], function(users) { next(null, users); }); } @@ -201,7 +200,6 @@ var RDB = require('./redis.js'), } posts.getPostSummaryByPids(pids, function(postData) { - postData = posts.filterBannedPosts(postData); if(postData.length > count) { postData = postData.slice(0, count); } diff --git a/src/routes/user.js b/src/routes/user.js index 1c13c1e5dc..a164e8d8f5 100644 --- a/src/routes/user.js +++ b/src/routes/user.js @@ -64,19 +64,13 @@ var user = require('./../user.js'), user.get_uid_by_userslug(req.params.userslug, function(uid) { if(!uid) { - next(); - return; + return next(); } - user.getUserField(uid, 'banned', function(banned) { - if(banned && banned === '1') { - 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']); - }); - } - }); + 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) { user.getUsers('users:joindate', 0, 49, function(err, data) { - data = user.filterBannedUsers(data); res.json({ search_display: 'none', loadmore_display:'block', users:data }); }); } function getUsersSortedByPosts(req, res) { user.getUsers('users:postcount', 0, 49, function(err, data) { - data = user.filterBannedUsers(data); res.json({ search_display: 'none', loadmore_display:'block', users:data }); }); } function getUsersSortedByReputation(req, res) { user.getUsers('users:reputation', 0, 49, function(err, data) { - data = user.filterBannedUsers(data); res.json({ search_display: 'none', loadmore_display:'block', users:data }); }); } @@ -380,7 +371,8 @@ var user = require('./../user.js'), else data.emailClass = "hide"; - + data.show_banned = data.banned === '1'?'':'hide'; + data.uid = uid; data.yourid = callerUID; data.theirid = uid; diff --git a/src/threadTools.js b/src/threadTools.js index a717d6c723..4e9efe9311 100644 --- a/src/threadTools.js +++ b/src/threadTools.js @@ -291,32 +291,14 @@ var RDB = require('./redis.js'), if(!numPosts) return callback(new Error('no-undeleted-pids-found')); - posts = posts.reverse(); - lastPostId = 0; - - function isPostVisible(post, next) { - if(post.deleted !== '1') { - user.getUserField(post.uid, 'banned', function(banned) { - if(banned && banned === '1') { - next(null); - } else { - lastPostId = post.pid - next(post.pid); - return; - } - }); - } else { - next(null); + while(numPosts--) { + if(posts[numPosts].deleted !== '1') { + callback(null, posts[numPosts].pid); + return; } } - - async.eachSeries(posts, isPostVisible, function(err) { - if(err) { - callback(null, lastPostId); - } else { - callback(new Error('no-undeleted-pids-found')); - } - }); + + callback(new Error('no-undeleted-pids-found')); }); } }(exports)); \ No newline at end of file diff --git a/src/topics.js b/src/topics.js index 79e0436956..fff4ee3ae4 100644 --- a/src/topics.js +++ b/src/topics.js @@ -78,11 +78,10 @@ marked.setOptions({ var fav_data = results[0], privileges = results[2]; - postData = posts.filterBannedPosts(postData); - for(var i=0; i 0) { user.search(username, function(data) { - user.isAdministrator(uid, function(isAdmin) { - if(!isAdmin) - data = user.filterBannedUsers(data); - - socket.emit('api:admin.user.search', data); - }); + socket.emit('api:admin.user.search', data); }); } else { socket.emit('api:admin.user.search', null);