The problem is that the Community Edition doesn't have the \ProcessMaker\Model\Users class which is used to update the last login date in the Enterprise Edition.
Here is how to fix it. Edit the file
workflow/engine/methods/login/authentication.php and change line 307 from:
Code: Select all if ($RBAC->singleSignOn) {
G::header('Location: ' . $sLocation);
die();
}
To:
Code: Select all if ($RBAC->singleSignOn) {
// Update the User's last login date:
$u = new Users();
$aUserProps = array(
'USR_UID' => $aLog['USR_UID'],
'USR_LAST_LOGIN' => $aLog['LOG_INIT_DATE']
);
$u->update($aUserProps);
G::header('Location: ' . $sLocation);
die();
}
Then, change line 380 from:
Code: Select all if ($activeSession){
setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/');
}
G::header('Location: ' . $sLocation);
To:
Code: Select all if ($activeSession){
setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/');
}
// Update the User's last login date:
$u = new Users();
$aUserProps = array(
'USR_UID' => $aLog['USR_UID'],
'USR_LAST_LOGIN' => $aLog['LOG_INIT_DATE']
);
$u->update($aUserProps);
$oPluginRegistry = PluginRegistry::loadSingleton();
if ($oPluginRegistry->existsTrigger ( PM_AFTER_LOGIN )) {
$oPluginRegistry->executeTriggers ( PM_AFTER_LOGIN , $_SESSION['USER_LOGGED'] );
}
G::header('Location: ' . $sLocation);
After making that code change, the last login date should appear:
LastLoginDateInUsersList.png (63.45 KiB) Viewed 6247 times