StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Session Locking - QuestionsExpand / Collapse
Author
Message
Posted 02/15/2007 12:13:57 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 12:38:37 PM
Posts: 308, Visits: 1,229
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

Post #6820
Posted 02/15/2007 1:47:18 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 4:58:13 AM
Posts: 4,379, Visits: 4,421
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.
Post #6822
Posted 02/15/2007 4:26:10 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 12:38:37 PM
Posts: 308, Visits: 1,229
Trent, this may be a dumb question, but where would I put this code? 

Thanks

Post #6833
Posted 02/15/2007 4:35:55 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 4:58:13 AM
Posts: 4,379, Visits: 4,421
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.

Post #6834
Posted 02/15/2007 4:42:04 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 12:38:37 PM
Posts: 308, Visits: 1,229
I would appreciate if you could post it.

Thanks

Post #6835
Posted 02/15/2007 4:45:05 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 2 days ago @ 5:02:56 PM
Posts: 2,682, Visits: 1,882
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
Post #6836
Posted 02/15/2007 4:51:13 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 4:58:13 AM
Posts: 4,379, Visits: 4,421
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
Post #6837
Posted 02/19/2007 1:13:28 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 2 days ago @ 7:31:07 PM
Posts: 1,241, Visits: 3,131
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.
Post #6967
Posted 02/19/2007 3:33:38 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 4:58:13 AM
Posts: 4,379, Visits: 4,421
It's fixed.
Post #6975
Posted 02/19/2007 4:15:15 PM
StrataFrame VIP

StrataFrame VIP