|
|
@ -7,6 +7,7 @@ var path = require('path'),
|
|
|
|
groups = require('../groups'),
|
|
|
|
groups = require('../groups'),
|
|
|
|
auth = require('./authentication'),
|
|
|
|
auth = require('./authentication'),
|
|
|
|
topics = require('../topics'),
|
|
|
|
topics = require('../topics'),
|
|
|
|
|
|
|
|
ThreadTools = require('../threadTools'),
|
|
|
|
posts = require('../posts'),
|
|
|
|
posts = require('../posts'),
|
|
|
|
categories = require('../categories'),
|
|
|
|
categories = require('../categories'),
|
|
|
|
categoryTools = require('../categoryTools')
|
|
|
|
categoryTools = require('../categoryTools')
|
|
|
@ -120,6 +121,8 @@ var path = require('path'),
|
|
|
|
|
|
|
|
|
|
|
|
app.get('/topic/:id/:slug?', function (req, res, next) {
|
|
|
|
app.get('/topic/:id/:slug?', function (req, res, next) {
|
|
|
|
var uid = (req.user) ? req.user.uid : 0;
|
|
|
|
var uid = (req.user) ? req.user.uid : 0;
|
|
|
|
|
|
|
|
ThreadTools.privileges(req.params.id, uid, function(err, privileges) {
|
|
|
|
|
|
|
|
if (privileges.read) {
|
|
|
|
topics.getTopicWithPosts(req.params.id, uid, 0, 10, false, function (err, data) {
|
|
|
|
topics.getTopicWithPosts(req.params.id, uid, 0, 10, false, function (err, data) {
|
|
|
|
if (!err) {
|
|
|
|
if (!err) {
|
|
|
|
if (parseInt(data.deleted, 10) === 1 && parseInt(data.expose_tools, 10) === 0) {
|
|
|
|
if (parseInt(data.deleted, 10) === 1 && parseInt(data.expose_tools, 10) === 0) {
|
|
|
@ -136,6 +139,10 @@ var path = require('path'),
|
|
|
|
})
|
|
|
|
})
|
|
|
|
} else next();
|
|
|
|
} else next();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
res.send(403);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
app.get('/category/:id/:slug?', function (req, res, next) {
|
|
|
|
app.get('/category/:id/:slug?', function (req, res, next) {
|
|
|
|