| | | StrataFrame User
       
Group: StrataFrame Users Last Login: 08/18/2008 11:47:34 AM Posts: 307, Visits: 1,223 |
| | I am testing out session locking and ran into a problem, and I'm not sure if I am misunderstanding something or have a logic issue. User 1 is currently logged in on a workstation and performs a session lock (F11). User 2 enters their login credentials in the locked session and becomes the active user. What happens to user 1, are they logged out? - Can I prevent this from happening by adding code somewhere? I only want to allow the original user access to the locked session, (except for maybe the administrator or security admin). My menu is built based on user permissions and I am having problems because user 2 should see some of the menu options available to user 1. Thanks Tim |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 5:44:29 PM Posts: 4,366, Visits: 4,393 |
| | You can save off the current user in the BeforeSessionLock event. In the AfterSessionLock event you can test to see if the same user has been entered. If not, you can show a message indicating that the same user must be logged back in and then show the login form again. |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: 08/18/2008 11:47:34 AM Posts: 307, Visits: 1,223 |
| | Trent, this may be a dumb question, but where would I put this code? Thanks |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 5:44:29 PM Posts: 4,366, Visits: 4,393 |
| | You will have to manually create a handler on the SessionLock class. You would add this handler in your AppMain in the InitAPplication method more than likley. It would look something like this: AddHandler MicroFour.StrataFrame.Security.SessionLock.BeforeSessionLock, Addressof YourMethodHandler You would then do the same thing for the AfterSessionLock. When you create the "YourMethodHandler" method, just make sure the signature is the same as the event (has the same number of parameters and types of parameters). It would just be a Sub. Private Sub YourMethodHandler(...) '-- Place your code here... End Sub If you can't determine the signature of the method let me know and I will post it for you. I can't remember it off of the top of my head. |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: 08/18/2008 11:47:34 AM Posts: 307, Visits: 1,223 |
| I would appreciate if you could post it.  Thanks |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: 08/01/2008 8:53:41 AM Posts: 2,671, Visits: 1,879 |
| | The handling method should have the same signature as System.EventHandler (the event is a type of System.EventHandler). Public Shared Sub (ByVal sender As Object, ByVal e As EventArgs) or public static void (object sender, EventArgs e)
www.bungie.net |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 5:44:29 PM Posts: 4,366, Visits: 4,393 |
| | Sure, it is below. When you download the 1.6 update, you will see that the docs now have a class library reference. You can get this type of information straight from the reference. You can also use the .NET Object Browser, or just use the intellisense tooltip: 
If you'll notice, the method below has the same signature as the highlighted area of the above image. The method name does not matter. You could call it TimsMethod as long as the signatures are the same. Public Sub HandleBeforeSessionLock(ByVal sender As Object, ByVal e As EventArgs) '-- Your code here End Sub |
| | | | StrataFrame VIP
       
Group: StrataFrame Users Last Login: Today @ 7:44:49 PM Posts: 1,194, Visits: 3,033 |
| | There was a bug in 1.5.1 where the AfterSessionLock event didn't fire. Was this fixed in 1.6? It wasn't mentioned in the "What's new in 1.6" help topic. |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 5:44:29 PM Posts: 4,366, Visits: 4,393 |
| | | | | StrataFrame VIP
 ![StrataFrame]() |
| |
|