logging unique IPs as well

v1.18.x
Julian Lam 11 years ago
parent aa71f1e088
commit c48d81379b

@ -964,9 +964,7 @@ var bcrypt = require('bcryptjs'),
}; };
User.logIP = function(uid, ip) { User.logIP = function(uid, ip) {
db.sortedSetAdd('uid:' + uid + ':ip', +new Date(), ip || 'Unknown', function(err) { db.sortedSetAdd('uid:' + uid + ':ip', +new Date(), ip || 'Unknown');
// Do nothing
});
}; };
User.email = { User.email = {

@ -278,6 +278,9 @@ process.on('uncaughtException', function(err) {
// Disable framing // Disable framing
res.setHeader('X-Frame-Options', 'SAMEORIGIN'); res.setHeader('X-Frame-Options', 'SAMEORIGIN');
// Log IP address
db.sortedSetAdd('ip:recent', +new Date(), req.ip || 'Unknown');
next(); next();
}); });

Loading…
Cancel
Save