v1.18.x
barisusakli 11 years ago
parent d233e7927d
commit 611c16b5a6

@ -65,6 +65,16 @@ categoriesController.get = function(req, res, next) {
page = req.query.page || 1,
uid = req.user ? req.user.uid : 0;
if (!req.params.slug && !res.locals.isAPI) {
categories.getCategoryField(cid, 'slug', function(err, slug) {
if (err) {
return next(err);
}
res.redirect('/category/' + slug);
});
return;
}
async.waterfall([
function(next) {
categoryTools.privileges(cid, uid, function(err, categoryPrivileges) {

@ -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) {

Loading…
Cancel
Save