diff --git a/src/controllers/users.js b/src/controllers/users.js index a1d5b84f19..0a2d4d0d67 100644 --- a/src/controllers/users.js +++ b/src/controllers/users.js @@ -44,9 +44,7 @@ usersController.getOnlineUsers = function(req, res, next) { show_anon: anonymousUserCount ? '' : 'hide' }; - plugins.fireHook('filter:userlist.get', {data: userData, uid: uid}, function(err, userData) { - res.render('users', userData.data); - }); + res.render('users', userData); }); }; @@ -76,9 +74,7 @@ usersController.getUsers = function(set, count, req, res, next) { show_anon: 'hide' }; - plugins.fireHook('filter:userlist.get', {data: userData, uid: uid}, function(err, userData) { - res.render('users', userData.data); - }); + res.render('users', userData); }); }; @@ -118,9 +114,7 @@ usersController.getUsersForSearch = function(req, res, next) { show_anon: 'hide' }; - plugins.fireHook('filter:userlist.get', {data: userData, uid: uid}, function(err, userData) { - res.render('users', userData.data); - }); + res.render('users', userData); }); }; diff --git a/src/user.js b/src/user.js index 0a83994964..998ce2db23 100644 --- a/src/user.js +++ b/src/user.js @@ -250,7 +250,13 @@ var async = require('async'), user['email:confirmed'] = parseInt(user['email:confirmed'], 10) === 1; }); - callback(null, results.userData); + plugins.fireHook('filter:userlist.get', {users: results.userData}, function(err, data) { + if (err) { + return callback(err); + } + + callback(null, data.users); + }); }); }); };