moved filter:user,get to central function

v1.18.x
barisusakli 10 years ago
parent c06132e779
commit ab69477b24

@ -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);
});
};

@ -249,8 +249,12 @@ var async = require('async'),
user.banned = parseInt(user.banned, 10) === 1;
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);
});
});
});
};

Loading…
Cancel
Save