By Ivan George Borges - 11/14/2006
Hi there.Please, would you guys know a way I could limit the number of concurrent logins for the user? Cheers.
|
By StrataFrame Team - 11/14/2006
You would need to create a database table of the users currently logged into the workstations. Then, you can manually use Login.AuthenticateUser() to determine whether the user can log into the system. Once you do that, you will need to test that table to make sure no user with that name is already logged in. Then, when the user logs out, remove the record from the tracking table. You will also most likely want to setup a timer on the main form to periodically (say every 15s to 1 minute) go and set the last "keep-alive" time on the record, so that in case the application dies or the workstation locks up, the user record in the tracking table will be "stale" and can be removed if the user tries to log into another workstation.
|
By Ivan George Borges - 11/14/2006
Thanks a lot Ben for the idea ... I was thinking about this way. Do you think the traffic generated to the server every 1 minute, for example, to save the "still-alive" time, would be a major problem in terms of an overall performance? And to you think that this is a feature that you guys would implement in the framework in the future? If so, I will imediately forget it ...
|
By StrataFrame Team - 11/14/2006
No, the traffic to set update the record once a minute would be minimal... only one SQL query. And it will be running on some back thread through the timer, so the user will never even know it's happening. We have discussed adding this functinoality, but we never made a descision on it. So, no promises from us, and if I were you, I would go ahead and implement it
|
By Ivan George Borges - 11/14/2006
Great, I will work on it.One thing, the right place to ask for the number of concurrent logins would be in the security user form ... I didn't want to mess with that.
|
By StrataFrame Team - 11/14/2006
You mean your custom login form? Nah, you just need to put your code in the cmdOK_Click() event handler. If the user hasn't exceeded the concurrent logins, then call the OnAttemptLogin(), otherwise, show them a message and don't call it.
|
By Ivan George Borges - 11/14/2006
No Ben, I mean I need a place to tell how many concurrent logins the user is allowed to. And I think this belongs to the SF Security "Edit User Item" form, doesn't it. This is the place for the user's properties.
|
By StrataFrame Team - 11/14/2006
Oh, hehe, yeah... You might have to create another form and table to store off "additional" user properties.
|
By Ivan George Borges - 11/14/2006
Nah, it's a free world ... I got to the conclusion that a user should be allowed to log all over the place ...
|
By StrataFrame Team - 11/14/2006
That's certainly one way to look at it
|