|
|
@ -81,7 +81,6 @@ module.exports = function (middleware) {
|
|
|
|
email: '',
|
|
|
|
email: '',
|
|
|
|
picture: meta.config.defaultAvatar,
|
|
|
|
picture: meta.config.defaultAvatar,
|
|
|
|
status: 'offline',
|
|
|
|
status: 'offline',
|
|
|
|
banned: false,
|
|
|
|
|
|
|
|
reputation: 0,
|
|
|
|
reputation: 0,
|
|
|
|
'email:confirmed': false
|
|
|
|
'email:confirmed': false
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -99,13 +98,13 @@ module.exports = function (middleware) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
navigation: async.apply(navigation.get),
|
|
|
|
navigation: async.apply(navigation.get),
|
|
|
|
tags: async.apply(meta.tags.parse, res.locals.metaTags, res.locals.linkTags),
|
|
|
|
tags: async.apply(meta.tags.parse, res.locals.metaTags, res.locals.linkTags),
|
|
|
|
banReason: async.apply(user.getBannedReason, req.uid)
|
|
|
|
banned: async.apply(user.isBanned, req.uid)
|
|
|
|
}, function (err, results) {
|
|
|
|
}, function (err, results) {
|
|
|
|
if (err) {
|
|
|
|
if (err) {
|
|
|
|
return callback(err);
|
|
|
|
return callback(err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (results.user && parseInt(results.user.banned, 10) === 1) {
|
|
|
|
if (results.banned) {
|
|
|
|
req.logout();
|
|
|
|
req.logout();
|
|
|
|
return res.redirect('/?banned=' + (results.banReason || ''));
|
|
|
|
return res.redirect('/?banned=' + (results.banReason || ''));
|
|
|
|
}
|
|
|
|
}
|
|
|
|