| | | 
Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 11:04:43 AM Posts: 809, Visits: 11,679 |
| | Hi there. Please, would you guys know a way I could limit the number of concurrent logins for the user? Cheers. |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 11:24:42 AM Posts: 2,686, Visits: 1,889 |
| 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.
www.bungie.net |
| | | | 
Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 11:04:43 AM Posts: 809, Visits: 11,679 |
| 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 ... |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 11:24:42 AM Posts: 2,686, Visits: 1,889 |
| 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 
www.bungie.net |
| | | | 
Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 11:04:43 AM Posts: 809, Visits: 11,679 |
| | 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. |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 11:24:42 AM Posts: 2,686, Visits: 1,889 |
| 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.
www.bungie.net |
| | | | 
Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 11:04:43 AM Posts: 809, Visits: 11,679 |
| | 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. |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 11:24:42 AM Posts: 2,686, Visits: 1,889 |
| Oh, hehe, yeah... You might have to create another form and table to store off "additional" user properties.
www.bungie.net |
| | | | 
Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Today @ 11:04:43 AM Posts: 809, Visits: 11,679 |
| Nah, it's a free world ... I got to the conclusion that a user should be allowed to log all over the place ... |
| | | |
|