moved ips down

v1.18.x
barisusakli 9 years ago
parent e37cbca977
commit e4cae9391c

@ -1,17 +1,17 @@
'use strict'; 'use strict';
var async = require('async'), var async = require('async');
user = require('../../user'), var user = require('../../user');
groups = require('../../groups'), var groups = require('../../groups');
languages = require('../../languages'), var languages = require('../../languages');
meta = require('../../meta'), var meta = require('../../meta');
plugins = require('../../plugins'), var plugins = require('../../plugins');
privileges = require('../../privileges'), var privileges = require('../../privileges');
categories = require('../../categories'), var categories = require('../../categories');
db = require('../../database'), var db = require('../../database');
helpers = require('../helpers'), var helpers = require('../helpers');
accountHelpers = require('./helpers'); var accountHelpers = require('./helpers');
var settingsController = {}; var settingsController = {};
@ -21,13 +21,7 @@ settingsController.get = function(req, res, callback) {
var userData; var userData;
async.waterfall([ async.waterfall([
function(next) { function(next) {
user.getIPs(req.uid, 4, next); accountHelpers.getBaseUser(req.params.userslug, req.uid, next);
},
function(ips, next) {
accountHelpers.getBaseUser(req.params.userslug, req.uid, function(err, data) {
data.ips = ips;
next(err, data);
});
}, },
function(_userData, next) { function(_userData, next) {
userData = _userData; userData = _userData;
@ -47,14 +41,18 @@ settingsController.get = function(req, res, callback) {
homePageRoutes: function(next) { homePageRoutes: function(next) {
getHomePageRoutes(next); getHomePageRoutes(next);
}, },
ips: function (next) {
user.getIPs(req.uid, 4, next);
},
sessions: async.apply(user.auth.getSessions, userData.uid, req.sessionID) sessions: async.apply(user.auth.getSessions, userData.uid, req.sessionID)
}, next); }, next);
}, },
function(results, next) { function(results, next) {
userData.settings = results.settings; userData.settings = results.settings;
userData.languages = results.languages;
userData.userGroups = results.userGroups[0]; userData.userGroups = results.userGroups[0];
userData.languages = results.languages;
userData.homePageRoutes = results.homePageRoutes; userData.homePageRoutes = results.homePageRoutes;
userData.ips = results.ips;
userData.sessions = results.sessions; userData.sessions = results.sessions;
plugins.fireHook('filter:user.customSettings', {settings: results.settings, customSettings: [], uid: req.uid}, next); plugins.fireHook('filter:user.customSettings', {settings: results.settings, customSettings: [], uid: req.uid}, next);
}, },

Loading…
Cancel
Save