mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-23 08:50:27 +01:00
closes #1126
This commit is contained in:
@@ -65,6 +65,16 @@ categoriesController.get = function(req, res, next) {
|
|||||||
page = req.query.page || 1,
|
page = req.query.page || 1,
|
||||||
uid = req.user ? req.user.uid : 0;
|
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([
|
async.waterfall([
|
||||||
function(next) {
|
function(next) {
|
||||||
categoryTools.privileges(cid, uid, function(err, categoryPrivileges) {
|
categoryTools.privileges(cid, uid, function(err, categoryPrivileges) {
|
||||||
|
|||||||
@@ -18,6 +18,16 @@ topicsController.get = function(req, res, next) {
|
|||||||
uid = req.user ? req.user.uid : 0,
|
uid = req.user ? req.user.uid : 0,
|
||||||
privileges;
|
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([
|
async.waterfall([
|
||||||
function(next) {
|
function(next) {
|
||||||
threadTools.privileges(tid, ((req.user) ? req.user.uid || 0 : 0), function(err, userPrivileges) {
|
threadTools.privileges(tid, ((req.user) ? req.user.uid || 0 : 0), function(err, userPrivileges) {
|
||||||
|
|||||||
Reference in New Issue
Block a user