How do you get a list of active users (i.e. users logged into a solution on Servoy)?
We tried using the Maintenance plugin as follows:
- Code: Select all
var aClients = plugins.maintenance.getConnectedClients()
var fvCLIENTS_number_connected = aClients.length
for ( var i = 0; i < fvCLIENTS_number_connected; i++ )
{
var oClient = aClients[ i ]
ds.addRow( [
oClient.getUserName(),
oClient.getApplicationType(),
oClient.getClientID(),
oClient.getHostAddress(),
oClient.getHostIdentifier(),
oClient.getHostName(),
oClient.getIdleTime(),
oClient.getLoginTime(),
oClient.getUserUID()
] )
}
but the '.length' property throws an error. We reported this as a bug to Servoy, and they responded as follows:
Resolution: Won't Fix
The typeError you get for length property is due to the usage of the length property related to the maintenance plugin (you use that when you get the connectedClients array). As the sample code says, the maintenace plugin is meant to run during solution import, using before or after import hook (so not from Smart/Web client). Therefore, we strongly recommend not to use the maintence plugin in such smart/web client scenarios.
Our customers are asking for this feature (it has been a feature in our Visual FoxPro version of the product for 25+ years). We do not want to give them access to the Sevoy HTML Admin pages as they are not technically saavy.
Thanks!