* Login count property for users

This commit is contained in:
Bryan Ashby 2015-07-29 22:14:26 -06:00
parent a15067fc21
commit e34f0ad688
1 changed files with 11 additions and 0 deletions

View File

@ -39,6 +39,17 @@ function login(callingMenu, formData, extraArgs) {
callback(err);
});
},
function updateUserLoginCount(callback) {
if(!user.properties.login_count) {
user.properties.login_count = 1;
} else {
user.properties.login_count++;
}
user.persistProperty('login_count', user.properties.login_count, function persisted(err) {
callback(err);
});
},
function recordLoginHistory(callback) {
userDb.serialize(function serialized() {