Merge remote-tracking branch 'origin/master' into 0.5.1

v1.18.x
barisusakli 11 years ago
commit 5dd90880d4

@ -151,13 +151,15 @@ module.exports = function(db, module) {
if (err) { if (err) {
return callback(err); return callback(err);
} }
results = results.map(function(item) { results = results.map(function(item) {
return item.value; return item.value;
}); });
values = values.map(function(value) { values = values.map(function(value) {
return results.indexOf(value) !== -1; return results.indexOf(value) !== -1;
}); });
callback(err, results); callback(null, values);
}); });
}; };

@ -16,7 +16,7 @@ var app,
middleware.isAdmin = function(req, res, next) { middleware.isAdmin = function(req, res, next) {
if (!req.user) { if (!req.user) {
return res.redirect('/login?next=admin'); return res.redirect(nconf.get('relative_path') + '/login?next=admin');
} }
user.isAdministrator((req.user && req.user.uid) ? req.user.uid : 0, function (err, isAdmin) { user.isAdministrator((req.user && req.user.uid) ? req.user.uid : 0, function (err, isAdmin) {

Loading…
Cancel
Save