Page 1 of 1

List of Active Users

PostPosted: Tue Jan 24, 2012 1:31 am
by kwpsd
Version: 6.0.4 - build 1227

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!

Re: List of Active Users

PostPosted: Tue Jan 24, 2012 10:50 am
by ngervasi
Have a look at the Usermanager plugin from Patrick Ruhsert.

Re: List of Active Users

PostPosted: Tue Jan 24, 2012 11:25 am
by mboegem
Scott Butler recently added his Robot plugin on ServoyForge as well.
Didn't look into it yet, but is seems to be doing kind of the same.
https://www.servoyforge.net/projects/robot

Re: List of Active Users

PostPosted: Wed Jan 25, 2012 11:50 pm
by kwpsd
Thanks, Nicola and Marc. I am looking into both suggestions.