issue #961 - fixed bug where if a moderators group was not found, it would cause the active users box to derp out. Also renamed the moderators priv group name

v1.18.x
Julian Lam 11 years ago
parent e176abae50
commit f8ea87b003

@ -187,7 +187,7 @@ var db = require('./database'),
};
Categories.getModerators = function(cid, callback) {
Groups.getByGroupName('cid:' + cid + ':moderators', {}, function(err, groupObj) {
Groups.getByGroupName('cid:' + cid + ':privileges:mod', {}, function(err, groupObj) {
if (!err) {
if (groupObj.members && groupObj.members.length) {
user.getMultipleUserFields(groupObj.members, ['uid', 'username', 'userslug', 'picture'], function(err, moderators) {
@ -197,7 +197,8 @@ var db = require('./database'),
callback(null, []);
}
} else {
callback(err, null);
// Probably no mods
callback(null, []);
}
});
};

@ -753,7 +753,7 @@ var bcrypt = require('bcryptjs'),
};
User.isModerator = function(uid, cid, callback) {
groups.isMemberByGroupName(uid, 'cid:' + cid + ':moderators', function(err, isMember) {
groups.isMemberByGroupName(uid, 'cid:' + cid + ':privileges:mod', function(err, isMember) {
if(err) {
return calback(err);
}

Loading…
Cancel
Save