logging unique IPs as well

This commit is contained in:
Julian Lam
2014-02-24 17:49:22 -05:00
parent aa71f1e088
commit c48d81379b
2 changed files with 4 additions and 3 deletions

View File

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

View File

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