Merge pull request #4959 from pichalite/login-sessions

move login sessions section to account info route
v1.18.x
Barış Soner Uşaklı 9 years ago committed by GitHub
commit 37f7b89e2a

@ -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:account_info]]'}]);

@ -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) {

Loading…
Cancel
Save