From e34f0ad688e749477cec1021e0448778f0d93b16 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Wed, 29 Jul 2015 22:14:26 -0600 Subject: [PATCH] * Login count property for users --- core/system_menu_method.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/system_menu_method.js b/core/system_menu_method.js index d13c2352..08790e3a 100644 --- a/core/system_menu_method.js +++ b/core/system_menu_method.js @@ -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() {