This commit is contained in:
barisusakli
2014-12-01 20:28:36 -05:00
parent 9023060008
commit be11577aa4
17 changed files with 174 additions and 185 deletions

View File

@@ -8,6 +8,7 @@ var async = require('async'),
topics = require('../topics'),
categories = require('../categories'),
meta = require('../meta'),
helpers = require('../controllers/helpers'),
privileges = require('../privileges');
function hasTopicPrivileges(req, res, next) {
@@ -31,7 +32,7 @@ function hasPrivileges(method, id, req, res, next) {
}
if (!canRead) {
return res.redirect(nconf.get('relative_path') + '/403');
return helpers.notAllowed(req, res);
}
return next();
@@ -53,7 +54,7 @@ function generateForTopic(req, res, next) {
}
if (topicData.deleted && !userPrivileges.view_deleted) {
return res.redirect(nconf.get('relative_path') + '/404');
return helpers.notFound(req, res);
}
var description = topicData.posts.length ? topicData.posts[0].content : '';
@@ -137,8 +138,8 @@ function generateForPopular(req, res, next) {
}
function disabledRSS(req, res, next) {
if (meta.config['feeds:disableRSS'] === '1') {
return res.redirect(nconf.get('relative_path') + '/404');
if (parseInt(meta.config['feeds:disableRSS'], 10) === 1) {
return helpers.notFound(req, res);
}
next();