Merge branch 'master' into user_groups

This commit is contained in:
Julian Lam
2013-09-01 16:14:24 -04:00
29 changed files with 438 additions and 291 deletions

View File

@@ -58,7 +58,7 @@ var express = require('express'),
// Middlewares
app.use(express.favicon(path.join(__dirname, '../', 'public', 'favicon.ico')));
app.use(require('less-middleware')({ src: path.join(__dirname, '../', 'public') }));
app.use(require('less-middleware')({ src: path.join(__dirname, '../', 'public'), prefix:nconf.get('relative_path') }));
app.use(nconf.get('relative_path'), express.static(path.join(__dirname, '../', 'public')));
app.use(express.bodyParser()); // Puts POST vars in request.body
app.use(express.cookieParser()); // If you want to parse cookies (res.cookies)
@@ -295,6 +295,11 @@ var express = require('express'),
async.waterfall([
function(next) {
categories.getCategoryById(cid, 0, function(err, categoryData) {
if(categoryData) {
if(categoryData.disabled === '1')
return next(new Error('Category disabled'), null);
}
next(err, categoryData);
});
},
@@ -403,10 +408,16 @@ var express = require('express'),
app.get('/reindex', function(req, res) {
topics.reIndexAll(function(err) {
if(err) {
res.json(err);
} else {
res.send('All topics reindexed');
return res.json(err);
}
user.reIndexAll(function(err) {
if(err) {
return res.json(err);
} else {
res.send('Topics and users reindexed');
}
});
});
});
});