From 0b431ec41c3f4ca8e9ba82fb5c74497d19dda2ea Mon Sep 17 00:00:00 2001 From: pichalite Date: Thu, 18 Aug 2016 00:15:36 +0000 Subject: [PATCH] move login sessions section to account info route --- src/controllers/accounts/info.js | 6 ++++-- src/controllers/accounts/settings.js | 8 +------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/controllers/accounts/info.js b/src/controllers/accounts/info.js index 1117cb28c1..11069194ea 100644 --- a/src/controllers/accounts/info.js +++ b/src/controllers/accounts/info.js @@ -18,7 +18,8 @@ infoController.get = function(req, res, next) { async.parallel({ ips: async.apply(user.getIPs, res.locals.uid, 4), history: async.apply(user.getModerationHistory, res.locals.uid), - fields: async.apply(user.getUserFields, res.locals.uid, ['banned']) + fields: async.apply(user.getUserFields, res.locals.uid, ['banned']), + sessions: async.apply(user.auth.getSessions, userData.uid, req.sessionID) }, function(err, data) { if (err) { return next(err); @@ -28,7 +29,8 @@ infoController.get = function(req, res, next) { ips: data.ips, history: data.history }, data.fields); - + + userData.sessions = data.sessions; userData.title = '[[pages:account/info]]'; userData.breadcrumbs = helpers.buildBreadcrumbs([{text: userData.username, url: '/user/' + userData.userslug}, {text: '[[user:settings]]'}]); diff --git a/src/controllers/accounts/settings.js b/src/controllers/accounts/settings.js index 9efa8ebe6b..3b169bf83c 100644 --- a/src/controllers/accounts/settings.js +++ b/src/controllers/accounts/settings.js @@ -37,19 +37,13 @@ settingsController.get = function(req, res, callback) { }, homePageRoutes: function(next) { getHomePageRoutes(next); - }, - ips: function (next) { - user.getIPs(userData.uid, 4, next); - }, - sessions: async.apply(user.auth.getSessions, userData.uid, req.sessionID) + } }, next); }, function(results, next) { userData.settings = results.settings; userData.languages = results.languages; userData.homePageRoutes = results.homePageRoutes; - userData.ips = results.ips; - userData.sessions = results.sessions; plugins.fireHook('filter:user.customSettings', {settings: results.settings, customSettings: [], uid: req.uid}, next); }, function(data, next) {