This commit is contained in:
barisusakli
2014-03-15 00:26:09 -04:00
parent d233e7927d
commit 611c16b5a6
2 changed files with 20 additions and 0 deletions

View File

@@ -18,6 +18,16 @@ topicsController.get = function(req, res, next) {
uid = req.user ? req.user.uid : 0,
privileges;
if (!req.params.slug && !res.locals.isAPI) {
topics.getTopicField(tid, 'slug', function(err, slug) {
if (err) {
return next(err);
}
res.redirect('/topic/' + slug);
});
return;
}
async.waterfall([
function(next) {
threadTools.privileges(tid, ((req.user) ? req.user.uid || 0 : 0), function(err, userPrivileges) {