[#1491] add user.loggedin on cron, some comments on remove-staging-users

This commit is contained in:
Tyler Renelle 2013-09-08 21:45:46 -04:00
parent cbe23f638a
commit ecc442285b
2 changed files with 12 additions and 0 deletions

View file

@ -4,6 +4,17 @@
* mongo habitrpg ./migrations/20130908_remove_staged_users.js
*/
/**
* If we experience any troubles with removed staging users, come back to a snapshot and restore accounts. This will
* give a peak into possible conflict accounts:
*/
/*db.users.count({
"auth.local": {$exists: false},
"auth.facebook": {$exists: false},
"history.exp.5": {$exists: 1},
$where: "this.todoIds.length != 1 && this.dailyIds.length != 3 && this.habitIds.length != 3 && this.rewardIds.length != 2"
})*/
/**
* Users used to be allowed to experiment with the site before registering. Every time a new browser visits habitrpg, a new
* "staged" account is created - and if the user later registers, that staged account is considered a "production" account.

View file

@ -489,6 +489,7 @@ api.cron = function(req, res, next) {
algos.cron(user);
if (user.isModified()) {
res.locals.wasModified = true;
user.auth.timestamps.loggedin = new Date();
}
user.save(next);
};