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);
|
user.getSettings(userData.uid, next);
|
||||||
},
|
},
|
||||||
userGroups: function(next) {
|
userGroups: function(next) {
|
||||||
groups.getUserGroups([userData.uid], next);
|
groups.getUserGroupsFromSet('groups:createtime', [userData.uid], next);
|
||||||
},
|
},
|
||||||
languages: function(next) {
|
languages: function(next) {
|
||||||
languages.list(next);
|
languages.list(next);
|
||||||
@@ -49,7 +49,9 @@ settingsController.get = function(req, res, callback) {
|
|||||||
},
|
},
|
||||||
function(results, next) {
|
function(results, next) {
|
||||||
userData.settings = results.settings;
|
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.languages = results.languages;
|
||||||
userData.homePageRoutes = results.homePageRoutes;
|
userData.homePageRoutes = results.homePageRoutes;
|
||||||
userData.ips = results.ips;
|
userData.ips = results.ips;
|
||||||
|
|||||||
@@ -425,9 +425,13 @@ var utils = require('../public/src/utils');
|
|||||||
};
|
};
|
||||||
|
|
||||||
Groups.getUserGroups = function(uids, callback) {
|
Groups.getUserGroups = function(uids, callback) {
|
||||||
|
Groups.getUserGroupsFromSet('groups:visible:createtime', uids, callback);
|
||||||
|
};
|
||||||
|
|
||||||
|
Groups.getUserGroupsFromSet = function (set, uids, callback) {
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function(next) {
|
function(next) {
|
||||||
db.getSortedSetRevRange('groups:visible:createtime', 0, -1, next);
|
db.getSortedSetRevRange(set, 0, -1, next);
|
||||||
},
|
},
|
||||||
function(groupNames, next) {
|
function(groupNames, next) {
|
||||||
var groupSets = groupNames.map(function(name) {
|
var groupSets = groupNames.map(function(name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user