From f8ea87b003701b49f6e1480d55b969d88f680edc Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 7 Feb 2014 12:10:46 -0500 Subject: [PATCH] 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 --- src/categories.js | 5 +++-- src/user.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/categories.js b/src/categories.js index f4becdb4c2..ff2978e0ba 100644 --- a/src/categories.js +++ b/src/categories.js @@ -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, []); } }); }; diff --git a/src/user.js b/src/user.js index b7a73de988..846f6f5486 100644 --- a/src/user.js +++ b/src/user.js @@ -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); }