mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
closes #4486
This commit is contained in:
@@ -33,7 +33,7 @@ settingsController.get = function(req, res, callback) {
|
||||
user.getSettings(userData.uid, next);
|
||||
},
|
||||
userGroups: function(next) {
|
||||
groups.getUserGroups([userData.uid], next);
|
||||
groups.getUserGroupsFromSet('groups:createtime', [userData.uid], next);
|
||||
},
|
||||
languages: function(next) {
|
||||
languages.list(next);
|
||||
@@ -49,7 +49,9 @@ settingsController.get = function(req, res, callback) {
|
||||
},
|
||||
function(results, next) {
|
||||
userData.settings = results.settings;
|
||||
userData.userGroups = results.userGroups[0];
|
||||
userData.userGroups = results.userGroups[0].filter(function(group) {
|
||||
return group && group.userTitleEnabled && !groups.isPrivilegeGroup(group.name);
|
||||
});
|
||||
userData.languages = results.languages;
|
||||
userData.homePageRoutes = results.homePageRoutes;
|
||||
userData.ips = results.ips;
|
||||
|
||||
@@ -425,9 +425,13 @@ var utils = require('../public/src/utils');
|
||||
};
|
||||
|
||||
Groups.getUserGroups = function(uids, callback) {
|
||||
Groups.getUserGroupsFromSet('groups:visible:createtime', uids, callback);
|
||||
};
|
||||
|
||||
Groups.getUserGroupsFromSet = function (set, uids, callback) {
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
db.getSortedSetRevRange('groups:visible:createtime', 0, -1, next);
|
||||
db.getSortedSetRevRange(set, 0, -1, next);
|
||||
},
|
||||
function(groupNames, next) {
|
||||
var groupSets = groupNames.map(function(name) {
|
||||
|
||||
Reference in New Issue
Block a user