@ -151,13 +151,15 @@ module.exports = function(db, module) {
if (err) {
return callback(err);
}
results = results.map(function(item) {
return item.value;
});
values = values.map(function(value) {
return results.indexOf(value) !== -1;
callback(err, results);
callback(null, values);
};
@ -16,7 +16,7 @@ var app,
middleware.isAdmin = function(req, res, next) {
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) {