mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-23 17:00:24 +01:00
display ips to admins/users on profile
This commit is contained in:
12
src/user.js
12
src/user.js
@@ -968,8 +968,16 @@ var bcrypt = require('bcryptjs'),
|
||||
db.sortedSetAdd('uid:' + uid + ':ip', +new Date(), ip || 'Unknown');
|
||||
};
|
||||
|
||||
User.getIPs = function(uid, callback) {
|
||||
db.getSortedSetRevRange('uid:' + uid + ':ip', 0, 5, callback);
|
||||
User.getIPs = function(uid, end, callback) {
|
||||
db.getSortedSetRevRange('uid:' + uid + ':ip', 0, end, function(err, ips) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
callback(null, ips.map(function(ip) {
|
||||
return {ip:ip};
|
||||
}));
|
||||
});
|
||||
};
|
||||
|
||||
User.email = {
|
||||
|
||||
Reference in New Issue
Block a user